Skip to content

fix(#512): Location field: address autocomplete and map preview (opt-in, no own server need - #618

Merged
BeSovereign merged 1 commit into
mainfrom
fix/issue-512
Oct 20, 2026
Merged

BeSovereign merged 1 commit into
mainfrom
fix/issue-512

Conversation

@BeSovereign

@BeSovereign BeSovereign commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Refs #512

Opt-in address autocomplete and map preview: off by default and nothing leaves the shard; the shard proxies Photon or Google Places and OSM tiles with a User-Agent, rate limits and caches, and a chosen place is saved as LOCATION plus GEO. The #348 CI failure came from concurrent first GET /api/calendars racing on MKCALENDAR, which returned an empty list; the default calendars are now created once per principal and errors are no longer swallowed. The #512 e2e uses a different place each run so the shard's caches cannot make it fail; merge conflicts with #513/#517 were resolved keeping both sides.

Driver gates (measured, not claimed)

  • Suites: lint: 1 passed, 0 failed | node: 1988 passed, 0 failed | python: 194 passed, 0 failed | e2e: 323 passed, 0 failed
  • Red/green check on declared tests: server/test/issue512_geocoding.test.js, server/test/issue512_default_collections_race.test.js, e2e/issue512_location_lookup.spec.js
red/green output
RED without the change:
e--stored-in-LOCATION-and-GEO-chromium/error-context.md

    Error Context: test-results/issue512_location_lookup-I-4dede--stored-in-LOCATION-and-GEO-chromium/error-context.md

    attachment #4: trace (application/zip) ─────────────────────────────────────────────────────────
    test-results/issue512_location_lookup-I-4dede--stored-in-LOCATION-and-GEO-chromium/trace.zip
    Usage:

        npx playwright show-trace test-results/issue512_location_lookup-I-4dede--stored-in-LOCATION-and-GEO-chromium/trace.zip

    ────────────────────────────────────────────────────────────────────────────────────────────────

  1 failed
    [chromium] › e2e/issue512_location_lookup.spec.js:48:1 › Issue #512 — location autocomplete and map preview only after opt-in; the place is stored in LOCATION and GEO 


GREEN with the change:
est: switched off again, nothing leaves the shard
    ok 12 - switched off again, nothing leaves the shard
      ---
      duration_ms: 16.988723
      ...
    1..12
ok 2 - Issue \#512 — address lookup and map tiles only after a per-user opt-in
  ---
  duration_ms: 3626.937077
  ...
# Subtest: Issue \#512 — the chosen place is stored in LOCATION and GEO
ok 3 - Issue \#512 — the chosen place is stored in LOCATION and GEO
  ---
  duration_ms: 5.140362
  ...
1..3
# tests 15
# suites 0
# pass 15
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 5530.773117


Running 1 test using 1 worker

  ✓  1 [chromium] › e2e/issue512_location_lookup.spec.js:48:1 › Issue #512 — location autocomplete and map preview only after opt-in; the place is stored in LOCATION and GEO (6.4s)

  1 passed (9.2s)

🤖 Generated with Claude Code

Opt-in address autocomplete and map preview: off by default and nothing leaves the shard; the shard proxies Photon or Google Places and OSM tiles with a User-Agent, rate limits and caches, and a chosen place is saved as LOCATION plus GEO. The #348 CI failure came from concurrent first GET /api/calendars racing on MKCALENDAR, which returned an empty list; the default calendars are now created once per principal and errors are no longer swallowed. The #512 e2e uses a different place each run so the shard's caches cannot make it fail; merge conflicts with #513/#517 were resolved keeping both sides.

Refs #512

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@BeSovereign

Copy link
Copy Markdown
Contributor Author

Security review (claude-fable-5-1): no blocking finding. Opt-in gate, auth/CSRF, SSRF surface, ICS/XSS injection, secret handling and error sanitizing all hold; tests have teeth (loopback upstream records hits, browser foreign-request assertion). Non-blocking: lookup cache shared across users is a guess-confirmation oracle (geo.js:219, key by user); plain fetch follows redirects from operator-configured upstreams (geo.js:141/257, prefer redirect:'error' or guarded dispatcher); shard-wide rate budgets let one member starve others; settings endpoint discloses configured upstream hostnames; non-security: geo_provider column has no migration in utils/migrations.js and the SPA boot now awaits /api/geo/settings, so existing DBs could fail to load; GEO line uses JS number formatting (exponent notation possible).

@BeSovereign
BeSovereign merged commit 579291a into main Oct 20, 2026
5 checks passed
@BeSovereign
BeSovereign deleted the fix/issue-512 branch October 20, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant