Commit Graph

2211 Commits

Author SHA1 Message Date
Maurice c84ec093d7 fix(journey): a failed notification never fails the write it reports
The contributor invite and the comment notification read the actor's
name before the fire-and-forget send, so a failing lookup turned an
already saved contributor or comment into an error answer.
2026-11-30 16:56:16 +01:00
Maurice cbdc6850ca fix(journey): keep a protected link's photos out of shared caches
The photo proxies answer public, max-age, so a proxy or CDN in front of
TREK could hand a password-protected link's photo to somebody who never
unlocked it. For a link with a password every Cache-Control the proxy
sets is turned private.
2026-11-30 16:56:16 +01:00
Maurice 6ac15213d9 feat(mcp): add_journey_comment, the MCP side of commenting on an entry
The REST route let everyone on a journey comment, but MCP could only
list, hide and delete. The tool runs through the same service and
checks. The in-app assistant is not offered it, since a comment speaks
in the user's name to the journey's people and the link's readers.
2026-11-30 16:56:15 +01:00
Maurice 9bc0be1716 fix(journey): open the follower mail links under the public path prefix
The confirm and unsubscribe pages lived at /journey-follow/, which the
client does not treat as a public path, so a reader without an account
could be sent into the proxy re-auth flow. They now sit under
/public/journey-follow/ beside the shared journey itself.
2026-11-30 16:56:15 +01:00
Maurice 52552133e3 feat(journey): comment on journal entries and follow a share link by email
The people on a journey can now talk about its entries, and a reader of its
share link can comment there too and follow the journey by email (#1702,

- journey_entry_comments holds a comment under an entry: by an account or
  signed with a name through the link, plain text up to 2000 characters. It
  goes with its entry and journey; a deleted account leaves it as unknown.
  Everyone on the journey reads and writes them, the author or an editor
  deletes one, an editor hides one from everyone but the editors.
- The share link gains allow_comments and allow_subscriptions (default 0,
  kept when a save leaves them out). Readers comment under the entries the
  link shows, behind the link's password gate, with a honeypot field and a
  limit per address and link. The public payload says what a reader may do.
- journey_share_subscribers holds an address following a link, with double
  opt-in: one mail asks to confirm it, nothing else is sent before. The mail
  links open app pages that post the token, so a scanner changes nothing.
  The owner lists and removes the addresses; they go with the link.
- A daily job (journey-digest) tells everyone on a journey about entries
  published since the last run (journey_entry_published, their settings
  apply, not about their own), mails each confirmed follower once a day in
  their language with an unsubscribe link and a List-Unsubscribe header, and
  forgets addresses unconfirmed for a week. journey_entries.announced marks
  what was told; existing published entries start as told.
- The owner hears about a new comment (journey_comment). Both events are
  translated in every locale, as are the follower mails.
- journey:entry:commented pings the journey's people; the journal page
  leaves it to the comments reader instead of reloading.
- MCP: list_journey_comments, set_journey_comment_hidden,
  delete_journey_comment, list_journey_subscribers, remove_journey_subscriber,
  and create_journey_share_link takes both switches like the REST route. The
  assistant is not offered the follower tools.
2026-11-30 16:56:15 +01:00
Maurice ea9d66868a feat(notifications): tell a new journey contributor they were added
Adding somebody to a journey was silent (#1669). The new journey_invite
event goes to the person added, in-app with a button to the journey and on
every channel they use, once: posting the same person again only changes
their role. The REST route and the MCP tool both go through
JourneyService.addContributor, so both send it; the send is fire and forget
like the trip and collection invites.

The event is listed while the Journey addon is on, with its label in the
notification settings, and its texts are translated in every locale.
2026-11-30 16:56:14 +01:00
Maurice 55fc5f6679 feat(journey): protect a public journey link with a password and an expiry
A journey's share link can now ask readers for a password, stop working on
a date its owner picks, and count how often it was opened (#2553, #1702,
no password, no expiry and no views.

- journey_share_tokens gains password_hash, password_version, expires_at,
  view_count and last_viewed_at (append-only migration, SQLite and
  Postgres, added only where missing).
- The password is hashed with bcrypt at the account cost. POST
  /api/public/journey/:token/unlock checks it, rate limited per address
  and link (only refusals count), and sets an httpOnly cookie scoped to
  the link's API path holding an HMAC over the token and the password
  version. Secure follows the request, so plain-HTTP installs keep working.
  Changing or removing the password raises the version and locks every
  old cookie out.
- Every public route, the photo proxies included, first checks the link:
  404 unknown, 410 expired (JOURNEY_LINK_EXPIRED), 401 locked
  (JOURNEY_PASSWORD_REQUIRED).
- Saving the share switches keeps the password and the expiry; the owner's
  read returns has_password, expires_at, view_count and last_viewed_at,
  never the hash, and none of it reaches the public payload.
- A reader is counted once a day per address and browser, in an in-memory
  store behind an injectable port; a restart may count them again.
- create_journey_share_link takes password and expires_at like the REST
  route; get_journey_share_link reports has_password.
2026-11-30 16:56:14 +01:00
Maurice 9b06bb8892 fix(journey): keep the GPX day import out of the assistant and cover the set-based upsert
The in-app assistant would be offered import_journey_gpx_days, whose only
input is GPX text the model would have to write itself; a recorded route has
to come from a real file, so the tool is denied there like upload_trip_file.
External MCP clients keep it.

JourneyRecordedDaysRepository.upsertDays had no repository test: add one for
the empty list, a multi-row insert and a replace that keeps the id and the
first time and leaves the other source's day alone.
2026-11-30 16:55:55 +01:00
Maurice 9f3722f459 feat(journey): keep recorded days from a GPX file beside Dawarich
A GPX file is a second source of a journey's recorded days (#3085). The
new route POST /api/journeys/:id/recordings/import-gpx (multipart, 15 MB,
edit access, no Dawarich needed) and the MCP tool import_journey_gpx_days
read the file's track segments through the place import's GPX reader,
place every timed point on its local day in the zone of where it was
recorded (or in one zone the caller fixes), cut the pieces at gaps, thin
them like a Dawarich day and keep one day per date with source gpx in one
transaction. Reading the file again replaces only its GPX days and leaves
an unchanged day and every Dawarich day alone; a day that changed pings
journey:recording:updated.

A GPX day is stored with source_kind tracks, so the existing contract
still reads it. DELETE :date and delete_journey_recorded_day take an
optional source, Dawarich's when left out. The shared map shows a GPX day
also without a published entry and prefers it over a Dawarich day of the
same date; the list of kept days carries both, ordered by date and source.
No migration: source and source_kind are text columns already.
2026-11-30 16:55:54 +01:00
Maurice cd20a0371f refactor(shared): share the thinning of a recorded line
Ramer-Douglas-Peucker and the even-stride cap move from the Dawarich
helpers into @trek/shared as thinRecordedLine and capLinePoints, so a
second source of recorded days thins its lines the same way. The Dawarich
helpers keep their names for them.
2026-11-30 16:55:54 +01:00
Maurice 535503b73d fix(journey): keep photo deletes out of the assistant and never let the capture reader block an upload
delete_journey_photos removes uploaded files for good and has no undo; its
generic approval card could only list ids, so the assistant is not offered it.
External MCP clients keep the tool.

A HEIC upload no longer fails when the lazily loaded capture reader cannot be
loaded: the photo goes up without its capture, as before. The upload schema's
doc comment is back on the schema it describes.
2026-11-30 16:55:54 +01:00
Maurice e59cd23e60 test(journey): pin the capture hint through the upload routes and the shared contract 2026-11-30 16:55:54 +01:00
Maurice 78c0f65de4 fix(journey): keep an iPhone photo's capture time and place through the HEIC conversion
The browser converts a HEIC to a JPEG before it uploads it, and that
JPEG carries no EXIF, so iPhone photos arrived without their capture
time and GPS. A small lazily loaded reader now takes DateTimeOriginal
with its offset and the GPS pair from the HEIC's Exif item before the
conversion, and journey photo uploads (gallery, entry, Studio) send them
as optional taken_at, lat and lng fields.

The server reads those fields leniently (an ISO instant between 1900
and tomorrow, a pair inside the globe that is not 0,0) and hands them to
the capture backfill only when the request carried one file. They fill
in only what the file's own EXIF lacks and go through the existing
COALESCE write, so a stored value is never replaced. Covers and place
images keep the plain conversion and never carry a location.
2026-11-30 16:55:54 +01:00
Maurice 555027f10f fix(journey): serve a medium preview to large photo tiles
Entry cards and the entry photo grid loaded the provider thumbnail (about
250 px for Immich) and drew it blurry. Photos now have a medium "preview"
rendition: Immich's preview, Synology's xl and a local photo's 800 px
thumbnail. GET /api/photos/:id/preview serves it behind the same access
check, and both share link photo routes now hand a preview on instead of
reading every size but thumbnail as the original. The entry grid, the
entry covers, the phone feed cards and the share page's large tiles ask
for it; small tiles keep the thumbnail.

The Synology picker named no size and got the 240 px rendition; its
tiles now ask for the medium one.
2026-11-30 16:55:53 +01:00
Maurice 3a300a3996 fix(journey): keep gallery deletes to their journey and refuse the owner role
Deleting a gallery photo ignored the journey id in its path and told no
other tab. JourneyGalleryService now holds every photo delete: it checks
the edit right and that each photo belongs to the journey named, queues
the files for release once the rows are gone and broadcasts
journey:updated. The REST routes and the new MCP tool
delete_journey_photos (up to 100 ids, all or nothing) go through it.

The contributor routes cast the role without checking it, so a raw body
could write role 'owner'. The shared contract now takes only editor or
viewer, the service refuses any other role, and the role update never
touches the owner's own row.
2026-11-30 16:55:53 +01:00
Maurice dbf011f026 fix(ci): use the bound database for map defaults and retry preloads
Write both defaults in one guarded statement so a SQLite source imported by the Postgres suite needs no Postgres lock. Release a failed speculative chunk promise so opening the map can retry it.
2026-11-30 16:45:35 +01:00
Maurice 54c54d5e65 fix(ci): repair map fixtures and keep renderer dependencies layered
Use the engine write lock for map defaults and clean the metadata-free test snapshot with Kysely. Model the Leaflet bridge option, keep the renderer failure state below the settings store, and make the tile tests independent of the transpiler quote style.
2026-11-30 16:34:55 +01:00
Maurice 5c133bbf40 feat(maps): start new installations with MapLibre Liberty 2026-11-30 16:24:50 +01:00
Maurice d8a93af2f5 feat(maps): one shared list of the shipped tile hosts for the CSP and the client
A GL map fetches its style and its tiles, so it can only draw from a host
the server's connect-src names. The raster presets and OpenFreeMap were
written out in the middleware while the client kept its own idea of them,
and nothing held the two together.

The hosts, their reasons and the default OpenFreeMap style now live in
shared/src/maps/map-defaults.ts. The middleware builds those sources from
the list, and the client takes the default style from it, so the renderer
choice the next steps add reads the same hosts the policy allows.

The policy an install sends stays byte for byte the same: a test pins the
whole connect-src in its order.
2026-11-30 16:22:50 +01:00
Maurice b27b3f6563 docs(maps): classify MAP_EXTRA_CONNECT_HOSTS and separate its wiki section
The app-config README lists every variable as boot-stable or runtime-toggled;
the new one was missing. The CSP takes it when the app is built, so it is
boot-stable. The wiki section also lacked the rule that separates it from
Storage & Paths like every other section.
2026-11-30 16:22:50 +01:00
Maurice fdfc034a68 fix(settings): a managed install keeps a map provider somebody chose
With the operator's Mapbox token a managed install replaced every empty or
Leaflet provider with Mapbox, including a Leaflet the user picked and a
Leaflet default the admin set. A plain "only when empty" would switch
everyone whose Leaflet row only exists because the settings form writes
every field (#1634), so the choice is recorded instead, by the server alone:

- map_provider_chosen on the user's settings, set when a write changes the
  provider the user is shown (so saving the form unchanged is no choice,
  and leaving the Mapbox a managed install shows is one). A client patch
  naming the key is dropped on both routes, false included, so no client
  can set or clear it.
- map_provider_default_chosen in app_settings, set when the admin saves a
  map_provider default and removed when it is reset.

Mapbox now replaces an empty provider, or a Leaflet without the mark of
where it came from. No stored row is rewritten: rows without a mark read
exactly as before. The client Settings type gains the read-only field.
2026-11-30 16:22:50 +01:00
Maurice 51dc0e6a82 feat(maps): MAP_EXTRA_CONNECT_HOSTS adds the operator's map hosts to the CSP
A GL map fetches its tiles and its style, so a template on a host of the
operator's own (a self-hosted tile server) was refused by connect-src while
Leaflet drew it as images. The new variable lists such hosts; each entry
becomes an https source in connect-src and the same list reaches the client
as map_extra_connect_hosts in the app config, so the renderer choice and the
policy can never disagree.

The variable is owned by readEnv() like the rest of the maps namespace and
read once when the middleware is applied. The boot refuses an entry outside
the shared grammar; a path that skips the boot check drops it, so a bad
value never widens the policy. Unset, the CSP and the app config are as
before apart from an empty list.

Documented in .env.example, docker-compose.yml, the Helm values and
ConfigMap and the wiki. Making room for the app config field shrinks
auth.service.ts by one line, and its size baseline follows.
2026-11-30 16:22:50 +01:00
Maurice 07d54d6f6e fix(maps): a place's marker photo is its community picture where it has one
An OSM or index place with a reviewed TREK Community picture showed it in
its gallery but only a category pin in the lists and on the map: the
marker photo asked Google and Wikimedia, never the community's pictures.
It now asks them first, the order the gallery shows them in, and only
while the TREK Places API is on.
2026-11-30 13:14:23 +01:00
Maurice e90380e2b4 fix(places): votes copied with a place keep when they were last changed
Saving a trip place into a list and copying a saved place into a trip
carried the votes with no change time, so each copy read as cast now and
could outrank a newer vote on another copy of the same place, moving the
entry's own vote, average, filter and sort. Both copies now carry the
source vote's time, as the vote carry-over already does.
2026-11-30 12:55:07 +01:00
Maurice 1997a49e3d chore(places): export only what other files use
The media targets, the rating label, the rating score constants, the rating
match and the copy editor types are read inside their own files only, which
lint:knip holds.
2026-11-30 00:33:35 +00:00
Maurice 8057688da3 fix(places): say why registering the join listeners writes nothing itself
onModuleInit only hands the list and trip joins their listener; each join
then carries the joiner's votes in a transaction of its own, which
lint:tx reads from the @txIndependent note.
2026-11-30 00:24:37 +00:00
Maurice 1c9ac0b159 fix(places): the second CI run, split the library reads and test the rating order
The reads of what an entry of All places keeps beside its facts (tags,
notes, votes, planned days, bookings, list roles) move from
PlacesLibraryRepository into PlacesLibraryDetailsRepository, so neither
file passes the size limit. New end to end tests cover the rating filter,
the tab counts under it, the rating order and its cursor, and
list_all_places with both. The test types follow the vote shapes, the edit
target says it may be null, the bookings pair names the booking card that
now holds the booking model, and the size baselines drop to the measured
lengths.
2026-11-30 00:06:47 +00:00
Maurice 7104fa6dd4 fix(places): the first CI run on the place view and the copies in step
Imports the picture icon the media sections draw for "use as the place
picture", narrows the types the type check refused, moves the dropdown
open state and the media lightbox into one module each for both views,
replaces an await in a loop, and lowers the ratchet baselines to the counts
the run measured. The tests follow the place view: the vote route of a trip
place lives with the votes now, the history holds an entry per copy that
followed an edit, the rate_library_place tool has its broadcast case, and
the row tags of a list are dots behind the name.
2026-11-29 23:53:36 +00:00
Maurice 783c98f41e feat(places): one vote per person across copies, copies stay in step
A vote belongs to its person: cast or taken back on one copy of a place, it
lands on every copy of that place in the lists and trips the person may vote
on, in one transaction. A pass on the first start carries the existing votes
over, and whoever joins a list or a trip brings their latest vote onto its
copies of the places they voted on elsewhere, as inserts that never
overwrite.

An edit of the general facts of a place (name, description, address,
position, category, picture, website, phone) on a trip place or a saved
place is made on every other copy of it the editor may edit, with a history
entry per copy and an announcement per trip and list. Notes, tags, status
and votes stay with each copy, and a copy the editor may not edit is
skipped. REST and MCP take the same path; a token reaches only the kinds of
copies it holds write scope for.

The entry rating names its voters, the library list filters by a lowest
average vote and sorts by rating, and the tab counts honour the filter.
2026-11-29 23:36:43 +00:00
Maurice 382ba79584 feat(places): visits read from trips, change history, linked tours and bookings, personal tags
A visit is a place planned on a day of one of the reader's trips; nothing is kept
or confirmed by hand. A place keeps a log of changes to its details, links the
tours and bookings it is about, and carries tags private to the reader, which a
copy into a trip takes along only when picked. Contracts, routes, MCP tools and
migrations for both engines.
2026-11-29 21:16:50 +01:00
Maurice f99c7f5421 fix(ci): the second round of gates after the places changes
- index.css stays at its size: the map canvas colour moves to its own
  stylesheet.
- The rating badge on map markers takes its amber and white from a class in
  ratingBadge.css instead of inline literals; the theme entry drops with it.
- Strict mode: the identity a link joins is resolved without a widened union,
  the description of an entry's origins is string or undefined, and the map
  search rows are typed.
- knip: PLACE_NAME_ATTR is module private, the linked-by enum names the values
  the service writes, and the unlink contract is its own described schema
  rather than a second name for the use schema.
- The duplicates hook test reads toasts through a module mock instead of the
  window hook; react-hooks/refs is lowered to the count the run measured.
- Tests follow the rename to Places and the list icon on an edit.
2026-11-29 16:38:53 +01:00
Maurice 62232ec87e fix(places): undo, unlink and dismissals that hold after a key or access change
Review findings on the place identities and trip list links:

- The assistant offers PlacesLibraryMcp, PlaceIdentitiesMcp and
  TripCollectionsMcp with the collections group (done with the CI fix).
- Undoing a merge restores the entries as they were: the merge logs, in its
  moved_link_ids JSON, each link it moved and each link it made with the use
  that link names, and whether the merged side became an own place only for
  the merge. The undo deletes what the merge made and moves the rest back,
  and only touches a link still in the leading place naming the same use, so
  a link id SQLite hands out again never moves someone else's link. The
  sweep counts a merge as spent by the same rule. Same unreleased migration,
  no schema change.
- A use can be taken out of an own place by the user's own link row also
  once its trip or list is out of reach; the answer then holds no entry, and
  the place left can be merged again.
- A dismissed duplicate is kept by one use of each side (an own place by its
  first link) and matched by the uses each entry holds, so it stays out when
  an entry becomes an own place or a merge is undone.
- link() checks the named uses with one targeted read instead of reading
  every use of the user, and the library reads its rows in blocks of 500 ids.
- Saved place reorders and the trip tags of a copy run one statement after
  the other again; a copy takes the first spelling of a tag name, as before.
- Unlinking a list from a trip takes place_edit alone, so a link to a list
  the writer cannot open can be taken off; a member leaving or taken off the
  trip takes the links whose list nobody left on it can open.
- The linked lists and their map places sort by lower(name), then by id, the
  same on both engines.
- list_all_places names the own:<id> keys and identity_id (MCP and wiki); the
  undo, unlink and trip unlink descriptions say what they do now; README
  counts 451 tools.
2026-11-29 16:27:12 +01:00
Maurice 7a06db393f fix(ci): repair server and shared gates after the place identities change
Push run 46275645144 on dev (f69a4c1a2) was red in these jobs:

- Server types: UserPlacesRepository.create, UserPlaceMergesRepository.create
  and UserPlaceLinksRepository.insert shadowed MikroORM's EntityRepository
  methods with other signatures (TS2416), which also broke defineEntity on the
  three entities (TS2769). They are createOwn, record and insertUses now.
- Server lint: collections.service.ts had grown to 1411 lines against 1410.
  The trip tag lookup of a copy moved into collections.helpers.ts
  (tripTagIdsOf, tagKeyOf); the size baseline is lowered to the 1398 it holds.
- ASTCAP-001/002/005b: the trip chat core had taken in PlacesLibraryMcp,
  PlaceIdentitiesMcp and TripCollectionsMcp, so core and the tours group
  offered 132 tools against 128. They load with the collections group now.
- PLIB-001, PLIB-MCP-001 and the places library e2e: the two entries named
  Museum tie on the name and go by their anchor, which the expected order
  hard coded the other way. The fixture orders every tie by its anchors.
- ENT-003 and CLASSFIELD-002: the five new entities and their 18 NOT NULL
  columns without a default are counted.
- Shared tests: collections.ratingBadge was missing in 26 locales; each has
  its translation now.
2026-11-29 16:14:42 +01:00
Maurice f69a4c1a24 feat(places): own place identities, duplicate merging and lists linked to a trip
- A user can group the uses of one place (trip places and saved places) into a
  place identity of their own (user_places, user_place_links). It is personal:
  it groups their "All places" and is never written into a shared trip or list
  row. An identity without a use they can still reach is not shown, and one
  left without links is pruned on their next write and nightly.
- Possible duplicates are suggested server side (same provider id, or the same
  name at the same spot), each pair with what differs and whether the user may
  merge it. A merge joins two identities in one transaction and can be undone;
  a dismissed pair does not come back. No trip or list row is deleted or changed.
- A trip can link lists (trip_collection_links, needs place_edit and access to
  the list). A member sees a linked list only with their own access to it; the
  map layer lists its places and whether each is already in the trip.
  tripCollections:changed tells the members to read their view again.
- REST, MCP tools and client data layer for all of it; migrations on both
  engines, additive only.
- CI: the stage 1 to 2 places-library helper types, and the await-in-loop and
  non-null counts it had raised.
2026-11-29 15:57:05 +01:00
Maurice 0ecca2b46c feat(places): read every place of the trips and lists in one view
A read-only overview of every place a user can reach: the saved places of
their lists and the places of their trips, viewer trips included, with tours,
tracks and the stops of a drive left out. A saved place and a trip place are
one entry only when the saved place came from that trip place, the trip is
still open to the user, and both agree (a provider id, or the same name at the
same spot); anything else stays apart. Every entry names where it comes from
and whether it may be changed there.

- GET /api/addons/collections/library/places: paged by cursor, search,
  category, kind, list, trip and status filters, counts per kind.
- GET /api/addons/collections/library/places/{trip|list}/🆔 one entry with
  what each origin keeps on its own (notes after the existing rights, labels,
  ratings, a trip's planned days, whether a stay or booking uses it).
- MCP tools list_all_places and get_library_place.

Nothing is written and nothing migrates; the rights are the existing list and
trip checks, read on every call.
2026-11-29 14:57:10 +01:00
Maurice 82165855c7 feat(collections): own order, KML/KMZ import, copy options, position search, place names on the trip map
- A list keeps its own order: drag a place by its grip (desktop and phone) or
  move it with the arrow keys. Reordering is off while a search or filter hides
  places and the list says why. New PUT /collections/:id/places/reorder and the
  MCP tool reorder_collection_places; new places go to the end. Client and
  server now order ties the same way (sort_order, oldest first, id).
- Copying saved places into a trip no longer takes their notes and tags along
  unasked. The picker offers both; a tag taken along becomes a trip tag (a trip
  tag of the same name is reused), never someone's personal tag.
- The source trip and place a saved place names are only kept when the user can
  open that trip and the place belongs to it.
- A KML or KMZ map can be read into a list: the dialog lists every placemark to
  keep or leave out and says which entries were skipped and why
  (POST /collections/map/read writes nothing; the import does).
- A saved place without coordinates says so and can be looked up on the map
  from its edit form, on the phone too, where a missing position could not be
  added at all. A typed address without a pick says it will not be on the map.
- The trip map can show the place names beside the pins (desktop and phone,
  both renderers). Names that would cover another pin or a control give way,
  the selected place and the planned stops first.
2026-11-29 14:57:00 +01:00
Maurice 80853fcf03 fix(ci): the Postgres engine forks its context without reaching into nest
Server lint: src/db may not import src/nest, so the Postgres engine opens the request context with RequestContext.create itself, as demo-reset and the backup restore already do. Server types: the base EntityManager has no execute(); RESTORE-002 reads through the connection.
2026-11-29 12:31:02 +01:00
Maurice 67049c1065 fix(backup): a restore that migrates no longer breaks the request it runs in
Restoring a backup whose database was behind the running version migrated it inside the admin's HTTP request. A MikroORM migration's getEntityManager() pins the migration's transaction on the EntityManager of the context it runs in, which was the request's. Once the migrations committed, every later read on that request failed with "Transaction is already committed": the storage registry reload kept the pre-restore config (uploads, including the archive's own, went to the old backend), and the restore's audit row was lost.

Both engines now run their migrations in a request context of their own (runSchemaBootstrap on SQLite, bootstrapPostgresSchema on Postgres), so the transaction stays on a throwaway EntityManager, at boot and on restore alike. RESTORE-002 restores a file six migrations behind head inside a request and reads on through that request's EntityManager.

Closes #3264
2026-11-29 12:00:08 +01:00
Maurice 00675c59b0 fix(ci): decouple realtime presence and test Atlas fill indices
Bind the realtime activity port to the existing SessionsService at app startup to remove the domain import cycle. Check the Atlas mesh through its triangle indices because degenerate rings can leave vertices that never contribute to the fill.
2026-11-29 11:06:16 +01:00
Maurice 96976d3ece test(atlas): settle the first CI round of the new Atlas tests
Client types: Array.at is past the lib target, typed mocks where a spy is called. Client lint: mock components named so hooks may run in them, state reported from effects instead of written into props, promises voided or awaited. Client tests: class order as passed, month names checked in Japanese whatever the ICU build, mesh vertex counts asserted by shape, the buffer growth case built from many small squares instead of one strip that took 15 s, the shooting star tests driving the sky's own schedule, and reduced motion mocked once so it no longer silences later tests. Server: the hidden-setting cases as it.each (no-await-in-loop), and the presence branches the realtime 100% threshold asks for.
2026-11-29 10:42:20 +01:00
Maurice 10ad92574d fix(ci): presence through the sessions domain, warm bags taken once, a slimmer planner page
Server lint: the realtime gateway injected the user_sessions repository, a table the sessions domain owns; it now asks SessionsService. The presence tests reuse the handshake's gateway instead of building one more by hand (test-new-service ratchet).

Client tests: the packing bags kept per trip leaked from one test (and one list) into the next; bags read ahead are now taken once as the list's first state, and only while bag tracking is on. The planner hook hands the page planMapKept, tourMapKept and the tour stage's class, so page tests that mock the hook keep working and TripPlannerPage is back at its size baseline (1127); the B4A wiring test reads the new condition.

Client lint: max-depth in src is down to 19, the baseline follows; the new websocket tests call onopen with ?. instead of a non-null assertion.
2026-11-29 10:13:53 +01:00
Maurice 5401728c41 feat(admin): online means a tab in front, and keeps last activity current
Online in the user list meant any open socket, so a tab left in the background showed as online for days while its last activity stood still. The client now sends a presence frame on connect and on every visibility change; only sockets whose tab is visible count as online (one that never sent the frame still counts, so older clients are unchanged). While a tab is in front, the gateway writes its session's last_seen_at at most every five minutes, on the frame and on the heartbeat, so last activity follows the online state.
2026-11-29 10:04:15 +01:00
Maurice cac5b5c501 fix(atlas): clear the knip findings of the globe Atlas
- The globe's geometry code types against geojson and
  topojson-specification; both are listed as client dev dependencies now
  (already installed through @types/topojson-client).
- Constants, helpers and types used only inside their own module lose
  their export.
- The GeoJSON types only the classic Atlas map read are removed; the knip
  baseline follows the lower counts in types.ts and offlineDb.ts.
2026-11-29 01:59:04 +01:00
Maurice a3db6e93bf fix(atlas): drop the keys the classic map left unused, tag the people reads
- lint:i18n-keys: common.reset, dawarich.bucket.visitedFrom and the two
  mobileAtlas keys were only read by the classic map and its popups; they
  go from every locale, and the atlas entry follows its lower count.
- lint:tx: AtlasPeopleService.profile also carries @txIndependent, so the
  method itself is no longer reported for its cache refresh reads.
2026-11-29 01:26:58 +01:00
Maurice e6ba039abc fix(atlas): share the wish form and tour figures, mark the people reads
- lint:dup: the add-a-wish form state and the tour figures of the hub were
  written twice, once per view; they live in useWishAddForm and
  tourHubFigures now, and both views read them.
- lint:tx: AtlasPeopleService.profile only writes through the region cache
  refreshes of the Atlas reads it calls, each complete on its own, so it is
  marked @txStandalone.
2026-11-29 00:53:28 +01:00
Maurice 6068c34c35 fix(atlas): keep auth.service at its size, finish the last ratchets
- The public config's feature switches, the Atlas comparison among them,
  move into a helper, so auth.service shrinks instead of growing past its
  size baseline (lowered to the new length).
- French "continents" in the many form is the French word too.
- useAtlasCountryActions no longer imports the API: off the offline list.
- The eslint baseline follows two lower counts.
2026-11-29 00:21:10 +01:00
Maurice 06b08cd9d5 fix(atlas): name the globe hook dependencies, cover the mesh routes
The second run of the globe Atlas was red on:

- Client lint: the engine getter is a stable callback now, so the hooks
  that call it name it (and the refs and setters they read); an unused
  navigate and a seven parameter label helper are gone.
- Atlas coverage: the mesh controller and the people and flights routes
  get unit tests, an unused region name helper is removed.
- The French "Atlas" is marked as the same word, index.css is back at its
  length, the server people service is formatted, and the baselines drop
  the deleted AtlasPage and follow the lower counts.
2026-11-28 23:48:47 +01:00
Maurice 10713e41cd fix(atlas): clear the client gates of the globe Atlas
Client lint, checks and tests were red on the globe Atlas:

- The views own the globe and sky refs and hand them into useAtlasGlobe,
  so reading its state while rendering no longer counts as reading refs.
- Helpers that shared a file with components move to their own modules
  (badge tiers, medal label, Dawarich notes, hub tabs, period label).
- The place search derives its loading state, the search resets its
  active row on input, and the two silenced hook dependencies are named.
- placeLabels, the hover chip and the overview figures are split up.
- Raw text sizes become type tiers, the badge unlock docks on --z-overlay.
- The stats card test follows the GlobeStat props; baselines lowered to
  the counts the run reported.
2026-11-28 23:14:17 +01:00
Maurice 04d134755a feat(atlas): flight routes, travellers and badges on the server
- GET /api/addons/atlas/flights folds the user's flight bookings into
  routes, airports and totals for the globe's arcs (#1369, #2642).
- GET /api/addons/atlas/people answers the Atlas side of other travellers
  on the instance: counts, visited countries and earned badges, never
  trips, places or dates. A user hides themselves with the atlas_hidden
  setting; the admin switch atlas_compare_enabled turns it off for all.
- shared/src/atlas/atlas-badges.ts holds the badge rules, computed from the
  data a user already has, so nothing is stored.
- MCP: list_atlas_flight_routes, list_atlas_badges, list_atlas_travellers.
2026-11-28 22:35:11 +01:00
Maurice 8510d4a729 build(atlas): build the globe geometry from the bundled boundaries
scripts/build-atlas-mesh.mjs turns the admin-0 and admin-1 GeoJSON the
server already ships into TopoJSON at three levels of detail per world and
two per country's regions, smoothed, quantized and Brotli-packed under
content-hashed names, plus a manifest with every country's anchor, box and
region index. It runs at build time (npm run build, npm run dev when the
sources changed, and the Docker server stage); the output is not committed.

/api/addons/atlas/mesh serves the manifest and the files as they are
(immutable, a year), decompressing as a stream for a client without br.
2026-11-28 22:35:10 +01:00