Commit Graph

5595 Commits

Author SHA1 Message Date
Maurice 91edf0c565 fix(mail-ingest): announce a place a mail created with its whole row
The open planners of the trip received only the new place's id and kept a nameless place without coordinates until a reload. The broadcast now carries the row the place routes send.
2026-11-23 15:11:30 +01:00
Maurice 403b7d2f93 fix(mail-ingest): make the own address once when two views ask for it together
The first look at the settings made the address outside a transaction and always revoked the live one, so two requests at once could leave a view showing a revoked address. It is now checked and made in one transaction and never replaces an address it finds.
2026-11-23 15:11:30 +01:00
Maurice 5d4cfec3b6 fix(mail-ingest): list the mail import tools only while the import is on
Every mail tool answered 'Mail import is not available' on installs that never switched the import on, which is the default, so they are now gated like the addon tools.
2026-11-23 15:11:30 +01:00
Maurice b9608bf684 fix(mail-ingest): keep the webhook open for real deliveries while bodies trickle in
The webhook now limits the memory the bodies being read hold instead of the number of open requests, and gives up on a body still arriving after a minute, so a few slow requests no longer turn every delivery away.
2026-11-23 15:11:29 +01:00
Maurice 3b65da7626 fix(mail-ingest): read transfer bookings instead of filing them as forwarding confirmations
A forwarding subject now counts only from Gmail or Microsoft or together with a code in the body, so 'Votre transfert est confirmé' is read as a booking. The subject and From header are also matched in linear time.
2026-11-23 15:11:29 +01:00
Maurice 327539df14 fix(mail-ingest): read forwarded attributions and HTML tags in linear time
A long line of reply verbs, or HTML with line break, script or style tags that never close, made the mail walk backtrack once per word and block the server. Attribution lines past 500 characters are no longer tested.
2026-11-23 15:11:29 +01:00
Maurice 965b519f23 test(notes): wait for the caret frame before typing in the numbered list test 2026-11-23 12:11:46 +01:00
Maurice 3ec7cc73b2 fix(notes): number list items in order from the format toolbar
The numbered list button always inserted '1. ' and only on the caret's line, so writing a list item by item left 1. 1. 1. in the field. It now continues from the item above and formats every line of a multi-line selection (bullets and quotes too).
2026-11-23 12:05:03 +01:00
Maurice 493571c559 fix(android): log the address and sender of a page that fails with an HTTP error
When the server's page came back with an error status, the app went to the
address screen with "HTTP 503" and logged nothing, not even which page it
was. A report could then not tell the server, a proxy in front of it and
something on the phone apart: the reporter's Cloudflare and Traefik logs
show no 503, and the page was not requested at all.

Every main-frame HTTP error is now logged under TrekShell with the page's
address (without its query, where a sign-in page carries a challenge), the
status, the reason phrase and the headers that name whoever answered
(Server, Via, CF-Ray, Content-Type). An answer with none of them says so,
which points at something on the phone. What the app does with the error
is unchanged.

Refs #3014
2026-11-22 22:58:02 +01:00
Maurice 4212fcdfc8 style(i18n): format the new PDF strings with an apostrophe
lint:format in shared: Prettier writes a string holding an apostrophe in
double quotes; the Catalan, French and Dutch PDF strings now follow it.
2026-11-22 22:39:01 +01:00
Maurice 28f750f7c4 fix(pdf): give formatMoney a locale, lower the strict entry of the export
lint:strict: a place's price passed the export's locale, which can be
undefined, to formatMoney; it falls back to en like the export's other
money figures. The rewritten TripPDF.tsx holds 1 strict error instead of 38,
and its entry is lowered to that.
2026-11-22 22:28:09 +01:00
Maurice 8c9cf4a80c fix(pdf): handle a failed cover bake where it happens, lower the eslint baseline
Client types: the overview test used Array.prototype.at, which the client's
lib setting does not include; it reads the last cell with slice instead.

Client lint: the export swallowed a failed cover bake with .catch(() => null).
bakePdfCover now catches a canvas that will not draw or encode itself and says
why, so the export calls it plainly. The rewrite also leaves fewer warnings,
and the baseline is lowered to the counts the run measured: complexity 216,
no-explicit-any 138, no-unused-vars 117, and in the tests
no-non-null-assertion 1872.
2026-11-22 22:19:51 +01:00
Maurice b33d592325 perf(pdf): draw the first pages once, not on every scroll
The cover and the route overview stuttered in the preview and in the saved
file, in every viewer:

- The cover photo was embedded at its upload size, 4000 px and more, under
  a translucent gradient across the whole page, which every viewer had to
  composite again on each redraw. The export now crops the photo to the
  page at print size (A4 at 150 dpi) and paints the shade into it, one flat
  JPEG. A photo from another origin keeps the photo and the gradient.
- The route overview drew every point of the routed roads, about 35,000 on
  a two-week trip and most of them on the same pixel, twice each (casing
  and line). Points that round onto the one before are dropped and the rest
  thinned within a third of a pixel (Douglas-Peucker): about 900 points,
  the same shape on paper.
- The cover's glass is a tinted fill without a backdrop blur, and the
  casing under the cover route is opaque.

Also spells out the span and status keys so the key check can follow them,
keeps types nothing imports private, and drops the export's theme and rtl
baseline entries, which reach zero.
2026-11-22 22:10:52 +01:00
Maurice 590b174dd1 feat(pdf): draw the trip's route on the cover, keep its figures on one line
The cover gains the trip's own shape: every routed day drawn in its map
colour on a glass card beside the title, a band of the days' colours with
the first and last date under it, and the dates on a pill above the title.
The figures sit in one row and never break inside a number.

Print engines leave out a backdrop blur, so the glass gets a tinted fill
that reads on paper; the blur stays for the preview. The dates of the day
overview are aligned to the start.
2026-11-22 21:52:27 +01:00
Maurice 2a833c4ba9 fix(pdf): keep a note's second line in its card, fill the preview width
A day note's time field is the free line the day plan prints under its
text, not a clock: it printed in the narrow time column and broke into a
word per line. It stays in the card again, and the time column is empty.

The preview showed the A4 sheet at its print width inside the wider
dialog, with a pale band on either side; on screen the document now fills
the frame, as it did before. The stops column of the day overview is
centred under its pin.

Tests for the day's cards, the cover and overview, and the new preview
switches.
2026-11-22 21:43:34 +01:00
Maurice a5de1bc52d feat(pdf): redesign the trip PDF
The trip PDF gets a new layout in the app's current look, with nothing it
printed before left out and more of each place on the page.

- Cover: the trip photo full bleed, title and dates over it, the trip's
  figures on frosted tiles.
- Overview: the route map, every day at a glance (colour, date, plan, the
  night's stay, stops, cost) and all bookings and stays with their codes.
- Days: the header in the day's map colour, a photo strip of the day's
  stops, where the night is spent, then the plan as a timeline with the
  times on the left.
- Places: photo or category tile, category, duration, price, rating, tags,
  address, coordinates, description, notes, opening hours of that day,
  phone, website, e-mail and the members going. The rating, e-mail, hours
  and reservation note come from the trip's place, since the assignment
  only carries a projection of it.
- Bookings: route first, then airline, number, seat or platform as badges,
  each leg with its own code, status and the booking's code.
- A second row of switches in the preview: overview, photos, coordinates,
  and contact and hours, next to page per day, large text and transport
  notes. Each one is a class on the document and remembered.

The document is split into modules for its helpers, icons, stylesheet,
cover and overview, and the day, so the export itself only gathers the data.
2026-11-22 21:34:29 +01:00
Maurice 1b20214a7f fix(planner): show the drive to a rental car's return and away from its pickup
On the day a rental car is picked up the route ended at the desk, and on the
day it is returned it started at the return, the way it does for an overnight
train. The drive with the car itself showed nowhere: a stop planned before the
return got no travel time to it, in the day plan on the phone and the desktop
and on the map, and neither did the first stop after the pickup.

A car or bicycle rental is now a stop the day's drive passes through on those
two days. Bookings that are ridden keep their one-sided endpoint, and two
bookings back to back still get no drive between them (#1394).
2026-11-22 19:48:34 +01:00
Maurice 3e8496dce6 feat(ios): hide the status bar where a corner capsule was measured
On a window where the app measured an element in a top corner, an iPhone
Duo's status capsule, it now hides the status bar, which is meant to take
the capsule away; whatever still covers the corner stays in the safe area
the page keeps clear of. Each window size keeps its answer once seen, so
hiding the bar never brings it back, and the folded and unfolded displays
decide on their own. Devices without such an element are not affected.
2026-11-22 19:36:31 +01:00
Maurice ea1b75e639 fix(mobile): keep every screen clear of the iPhone Duo's status capsule
The capsule in a top corner was handled screen by screen: the m-corner-*
classes and --m-corner-clear put bars beside it and lifted content below
it, so every layer that did not opt in sat under it, and testers found it
on almost every page.

It now counts as safe area in mobile.css. Upright the top inset reaches
below the capsule and the sides keep their full width; on a wide window
its side is given up over the whole height instead. The per-screen
handling and corner.css are gone. Control rows a screen places itself and
layers that fill the window keep to the side insets through m-safe-row and
m-safe-trail, and the trip's pane keeps its content off the capsule's side
on a wide window. On every other device the insets come out as before.
2026-11-22 19:36:31 +01:00
Maurice c0f6551cf4 test(server): send the API key requests without awaiting in a loop
Server lint counted one no-await-in-loop warning over the tests baseline, from the loop in the new API key test.
2026-11-22 18:24:15 +01:00
Maurice 1fdf74e7f2 fix(auth): mark an address the account moved before an admin saved it
Both backfills of email_self_asserted skip any account with an
admin.user_update row naming email. The edit dialog sends the email on every
save, so a role change made long after an account moved its own address kept
it at 0, and a verified SSO sign-in with that address still linked into it.

A new migration reads the address each admin save found (targetUser): an
account is marked when every save already found its current address, or when
the last save that found another one sent no email. A save that may have typed
the current address in still leaves the account alone, since the audit rows
cannot tell it from a change the account made itself before 5.0.0. Only rows
still at 0 are touched and nothing is cleared.
2026-11-22 18:15:51 +01:00
Maurice c7de823c78 fix(auth): renew a session cookie only after it verifies on its own
SessionRenewalInterceptor took req.user as proof that the trek_session cookie
had been verified. On a route with its own guard chain that does not hold:
ApiTokenGuard authenticates a public API key and sets req.user, and the cookie
sent beside it is never checked. Past half its lifetime such a cookie was
decoded without its signature and renewed, so a holder of a read-only key
could come away with a signed session of the key's owner.

The interceptor now runs the cookie through the guards' own check (signature,
expiry, password version, active session) before it renews, requires it to
name the request's user, and renews nothing on a request a public API key
authenticated.
2026-11-22 18:15:51 +01:00
Maurice 49b9ffc77d fix(client): keep the seat change clear of the sheet's held ref and of non-null assertions
Client lint was red: passing the ref-held reservation to bookingSeats added a react-hooks/refs warning in MTransportSheet, so the sheet now reads the seats from the legs it already has (seatsOfLegs). The new PDF test used a non-null assertion.
2026-11-21 15:45:04 +01:00
Maurice 7006891ce0 style(server): format the legs-only seat test
Server lint was red: lint:format found the new update_transport cases in tools-transports.test.ts unformatted.
2026-11-21 15:37:00 +01:00
Maurice 4d01439c75 test(server): type the created transport in the legs-only seat test
Server lint was red: the new MCP test cast its result to any, one no-explicit-any warning over the tests baseline.
2026-11-21 15:29:53 +01:00
Maurice adb6a2c80d fix(planner): show each leg's own seat on a flight with a stop
A flight with a stop saves a seat per leg, but every view read the
booking's flat seat, which mirrors the first leg's. A seat booked only on
the second leg showed nowhere, and one on the first leg showed on both.
#2701 had fixed this for trains only.

- getFlightLegs reads each leg's seat. The first leg falls back to the flat
  seat, as the booking form does, so older bookings keep theirs.
- bookingSeats lists the seat of every leg that has one with its route.
  The detail views (the phone's transport sheet, the booking detail) show
  each leg's seat under its route ("Seat IST → JFK"), and a leg opened
  from its row shows its own. The cards and field grids (bookings list,
  the phone's Bookings and Transports tabs, the day plan's transport
  detail) hold every seat in one Seat cell, so a card cutting its grid
  short no longer drops the second leg's.
- The day plan's flight leg rows carry their seat, and the PDF prints a
  flight's seat, direct or per leg.
- The watch and the Wallet pass name every leg's seat of the booking.
- A legs-only MCP update sets the flat seat, airline and flight number
  (train number and platform) again from the new first leg, so a seat
  taken off the first leg does not live on in the flat seat. A flat value
  the stored first leg never had stays.

Closes #3158
2026-11-21 15:24:52 +01:00
Maurice 1824cc77ec fix(ci): bring the per-trip addon tests and ratchets in step
The second run of #3157 was red in six jobs:
- Server types: ReminderJobsService takes AddonsService now; RJOB-007 built
  it with five arguments.
- Server tests 2/10: the doc-sync job tests stubbed AddonsService without
  isEnabledForTrip, which the sync asks per trip now.
- Client tests 4/10: toursPermissions mocked useAuthStore as a bare
  selector; tripAddonsStore keys its lists by account through getState.
- Server lint (knip): TripAddonRow was exported without a reader outside
  its file.
- Client lint and Client types: no-unused-vars and the strict errors in
  useTripPlanner.ts went down by one, so their entries are lowered.
2026-11-21 14:00:02 +01:00
Maurice 9e2805fc89 chore(lint): lower the server no-unused-vars baseline to 34
Server lint was red: the per-trip addon change left one unused variable fewer in src, and the ratchet fails on an entry above the count.
2026-11-21 13:28:06 +01:00
Maurice 77380ea5cf docs(wiki): describe the trip settings' Addons area and its MCP tools 2026-11-21 13:23:09 +01:00
Maurice 9956c58dd5 feat(client): follow and switch a trip's own addons
- The trip's addon list is read through tripAddonsRepo into
  tripAddonsStore (per account and trip, kept in Dexie version 16 for
  offline), refreshed when the connection returns and live on
  tripAddons:changed.
- The planner's tabs, dock, rail and deep links, the cost, tour and list
  readers, the PDF export, the share link options, the widgets and the
  watch follow the trip instead of the instance switch.
- Trip settings gets an Addons area for the owner, on the desktop dialog
  and the phone sheet, on one useTripAddonRows hook: each trip addon with
  its switch, marked "This trip only" while it differs from the instance.
  Switching back to the instance's value drops the trip's choice.
  Switching needs a connection.
2026-11-21 13:23:09 +01:00
Maurice 3f38621024 feat(server): let a trip owner switch trip addons for one trip
A trip can now turn a trip addon (lists, costs, documents, collab, road
trip, tours) on or off for itself, whatever the instance switch says. No
row in the new trip_addon_overrides table means the trip follows the
instance; a row is the owner's choice. Going back to the instance setting
deletes the row, and no addon data is touched either way.

- GET/PUT /api/trips/:tripId/addons[/:addonId] (every member reads, the
  owner writes) and the MCP tools get_trip_addons and set_trip_addon, on
  the shared tripAddons contract; tripAddons:changed tells the members.
- Every trip-scoped addon surface asks the trip: REST through
  TripAddonGuard, MCP through a per-call gate on the named or pinned trip,
  plugin RPC and events, the share link, the offline bundle, reminders,
  doc sync, the assistant (tools, keep_attached_file), booking costs, the
  trip summary prompt, and the cross-trip tour reads (library, Atlas
  stats, collection save).
- Routes without a trip open while the addon is on in any of the user's
  trips. Switching an addon on that the instance has off ends the members'
  MCP sessions so they reconnect with its tools.
- A copied trip takes its owner's choices along.

Behaviour changes: an anonymous call to an addon route that is off now
gets 401 instead of 404, and with an instance switch off the packing,
todo and files plugin RPC methods, the files MCP tools, todo reminder
mails, core plugin events, plugin view contributions, the share link's
lists, costs and chat sections and the offline bundle's lists follow it.
2026-11-21 13:23:09 +01:00
Maurice 2f7b8357ce fix(server): schema-qualify the table the move asks Postgres for its sequence
Server Postgres 18 3/3 was red on dev: PGMOVENUL-007 failed with relation "information_schema_catalog_name" does not exist. readTargetSchema called pg_get_serial_sequence(format('%I', table_name), ...) over information_schema.columns, and Postgres does not promise to apply the table_schema filter first, so the call could see rows of information_schema itself, whose bare names do not resolve on the search path. The name now carries its schema, so the call answers for every row whatever the plan. The fake Postgres of the move tests matches the new text.
2026-11-21 11:30:06 +01:00
Maurice 6861687b1f fix(server): queue the backfill's updates instead of awaiting them in a loop
Server lint was red on dev: lint:warnings counted 557 no-await-in-loop warnings in src against a baseline of 556, from the UPDATE the new admin-made account backfill awaited per account. The updates are now queued with addSql, the way the Ireland counties migration queues its row writes, with the id checked to be an integer. The migration does the same as before; it has not shipped in a release.
2026-11-21 11:22:47 +01:00
Maurice 8fc9fe7945 fix(auth): mark an address an admin-made account changed itself, so SSO no longer links to it
The 5.0.0 backfill (Migration20200101042800) set email_self_asserted only for accounts whose address moved away from their user.register audit row. An account created in Admin > Users has only an admin.user_create row, so it kept 0 even when the account had changed its own address in its settings before the upgrade, and a verified SSO sign-in asserting that address was still linked into it.

A new migration applies the same rule with the address in the admin.user_create row as the baseline: an admin-made account whose address is none it was created or registered with, and whose email no admin edited, is marked. Only rows still at 0 are touched and nothing is cleared. The shipped migration stays as it is.
2026-11-21 11:12:34 +01:00
Maurice f668eee227 test(client): drop the two new non-null assertions in the addon card tests
Client lint was red: lint:warnings counted 1877 no-non-null-assertion warnings in tests against a baseline of 1875, both from closest('section')! in FE-ADMIN-ADDON-045 and 046. Cast to HTMLElement like the other card lookups in the file.
2026-11-21 10:59:35 +01:00
Maurice 711015d5fd feat(admin): live flight status, booking mail import and paddle water data as rows of the addon cards
The addons page listed the trip, global and integration addons and then three
loose cards under them: live flight status, the booking mail import and the
paddle water data. They now sit where they belong, as rows of the cards:

- Live flight status is a row of the trip card, with its switch, locked when
  FLIGHT_LIVE_ENABLED holds it.
- The booking mail import is a row of the integration card with its switch;
  while it is on, "Set up mail import" opens the transport, address, AI
  allowance, test and status in a dialog, the way AI is set up.
- The paddle water data are a row under the Tours addon that opens the
  regions in a dialog, counting the open requests, else the regions.

The phone follows with the same rows and bottom sheets. The setup row and the
setup dialog are shared components (AddonSetupRow, AddonSetupDialog on the
desktop, MAdminOptionRow and MAdminSetupRow on the phone), the card counts
stay the addons' own, and the settings tab loses its features part.
2026-11-21 00:23:13 +01:00
Maurice 6ebd5cf0c7 fix(mobile): a road trip stage draws only its own rides, not the drive's flight home
The phone's road trip tab shows one stage at a time, but its map drew the
arcs of every ride that seams the whole drive, plus every booking switched on
for any day. A flight home on the 12th then crossed the map of the stage on
the 9th, with its airport label, as if it were part of that day.

The stage now draws the rides that seam its own drive, whatever day they were
booked on, and of the bookings switched on by hand only those that run on the
stage's day. The all-days view and the desktop, which shows the whole drive,
are unchanged.
2026-11-20 23:00:52 +01:00
Maurice 8ab7547edf fix(calendar): a booking linked to a plan stop gets its zone and is exported once
The calendar feed and the .ics export wrote a restaurant booking linked to a
plan stop twice, and the booking's copy without a time zone:

- The zone of a booking came only from its own place. A booking whose place
  is its linked stop (reservations.assignment_id) had none, so its DTSTART and
  DTEND went out as floating times and calendar apps placed them in the
  device's zone, an hour early for a London lunch read in Paris. The zone now
  comes from the booking's place, then its linked stop's place, then the zone
  all stops of its day or of the trip agree on. Transports keep their
  endpoint zones and still float when those are unknown, since either end can
  be in another zone.
- The stop and its booking were both emitted (trek-assign-<id> and
  trek-res-<id>). As for hotels, a stop whose booking yields a timed event on
  the same day is no longer emitted on its own; the booking event takes over
  the stop's place as LOCATION, its notes and, when it has none, its end. A
  booking without a clock, on another day, or still staged leaves the stop as
  it was, so no event is lost.

The VTIMEZONE builder moved unchanged into calendar-timezones.helpers.ts to
keep the service under the size cap.

Closes #3150
2026-11-20 22:19:11 +01:00
Maurice f599892a4b test(server): delete the tracked uploads together, not one await per loop turn 2026-11-20 21:49:40 +01:00
Maurice 1436cec35c test(server): suites remove only the uploads they stored, not whole shared folders
files, security, collections, journey and trips cleaned up by removing a whole
uploads category folder (uploads/files, covers, places, journey). Every suite
that boots the app writes into the same uploads tree, and on the Postgres lane
several run at once, so that removal took the files of the suite running
beside it: ATTE2E-008 then failed with "storage object not found" for its
attached file.

A small helper wraps StorageService.put on the app's instance, records what
the suite stores and deletes exactly that afterwards. The journey upload tests
that counted the files in uploads/journey (and so also counted what another
suite wrote there) now check that every object they stored is gone again.
2026-11-20 21:45:05 +01:00
Maurice fe90502955 fix(mobile): show stay names whole in the day card's chip strip
The stay chips in the day card's header shrank to fit beside the day pill and
the weather, so a name could end after one or two letters (H..., Br...). They
now keep their size and show the whole name; the strip scrolls sideways
instead, with its ends fading while more waits behind them.
2026-11-20 19:29:57 +01:00
Maurice 0431741ad7 fix(widgets): size the timeline's time column to the longest time shown
The day timeline in the trip widgets gave every time a fixed 38 pt column,
enough for 09:30 but not for a 12-hour clock: 5:45 AM was cut to 5:4... at
every widget size. The column now takes the width of the longest visible time
(and the now marker's label), at least the old 38 pt, so the dots still stand
in one line.
2026-11-20 19:29:56 +01:00
Maurice fa99940945 test(platform): a share-token photo whose copy fails to build is a 404 2026-11-20 19:15:48 +01:00
Maurice 09316025c3 test(share): sweep tests in the thumbnail job, tx and strict baselines follow the resolver split 2026-11-20 18:33:42 +01:00
Maurice 100313cfa9 fix(share): compare the pending rendition build with undefined 2026-11-20 18:23:20 +01:00
Maurice 411ec4af59 fix(share): keep private data and photo locations out of public trip and journey links
Public trip and journey share links handed out more than the owner chose to
share:

- A travel-only trip link still returned every day's title, and every link with
  the map returned the free-text day notes the shared page never shows. Days now
  go out through a public projection without notes, and travel-only links carry
  no day titles. Day notes, packing, budget and chat use explicit field lists
  too, and the category list holds only the categories the shared places use,
  without creator ids.
- The public journey payload spread whole entry and photo rows, including
  storage keys (file_path, thumbnail_path) and internal fields. It is now built
  from allow-lists and pinned by a strict response contract.
- /uploads/journey served every entry photo, original and video to anyone who
  knew the file name, so a URL kept working after a share link was revoked or
  the gallery switched off. It now serves journey covers and other non-entry
  objects only; entry media go through the token-checked proxy.
- Anonymous byte paths served stored originals unchanged, so EXIF GPS left the
  server even with map sharing off. Every public path (journey share proxy,
  covers, trip share photos, public uploads) now sends a copy with location
  data blanked in place (EXIF GPS, XMP and IPTC location, MP4/MOV location
  atoms), falling back to a metadata-free re-encode or a 404, never the raw
  file. Owners and members still get their originals.
- An entry's visibility field never decided the share link but was offered by
  MCP and the assistant as if it did. It is now documented as having no effect
  and no longer shown as a privacy label; is_draft keeps an entry off the link.
2026-11-20 18:18:50 +01:00
Maurice ec7f5e0585 test(atlas): cache the test places' regions in one go rather than an awaited loop 2026-11-19 22:11:29 +01:00
Maurice 8e38749bc3 fix(transit): show every stop name and each ride's arrival in the folded-out itinerary
The same gap as on the phone (#3139) in the desktop day plan's folded-out
transit row and the assistant's transit card: each ride cut its stop names
to one line and showed only its departure, and a walk cut its target. The
names and the walk target now wrap, and each ride shows its arrival under
its departure. The phone's booking sheet lets the route line under its
title wrap too.
2026-11-19 21:57:28 +01:00
Maurice 2c17edd74c docs(docker): the entrypoint drops to node with setpriv, say so beside its copy 2026-11-19 21:57:28 +01:00
Maurice c5e2afc21b fix(atlas): count places and cities the same way on the Atlas page and in the stats API
The Atlas page showed 100 cities and 169 places where GET /api/v1/stats
and the dashboard's passport card showed 66 and 164 for the same account.
The two sides counted with their own code. The Atlas page took the address
part right before the country as the city, which is often the region
(Bavaria for Munich, Nuremberg and Regensburg alike), and counted a bare
place name with no comma as a city. The stats side read its places with a
DISTINCT over address, coordinates and region only, so two places that
looked alike (the same hotel on two trips, places with neither address nor
coordinates) counted once, and its city reader skipped every address part
with a digit, so "10178 Berlin" never counted as Berlin.

Both now take places and cities from one method: every place counts once,
a city is read with cityFromAddress, which skips the region (#1115) and now
reads a city written beside its postcode (German, French, US, Japanese,
Dutch, British and Canadian forms) while a street with its house number
still does not count, and two spellings that differ only in case are one
city. The Atlas page, the passport card, /api/v1/stats and the MCP atlas
tool follow it. The response shapes are unchanged.

Closes #3137
2026-11-19 21:57:28 +01:00