Skip to content

fix(map): close live geolocation deployment drift - #7

Merged
llfzzz merged 2 commits into
mainfrom
claude/amap-real-provider-verification
Jul 20, 2026
Merged

fix(map): close live geolocation deployment drift#7
llfzzz merged 2 commits into
mainfrom
claude/amap-real-provider-verification

Conversation

@llfzzz

@llfzzz llfzzz commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a gitignored, map-service-only environment template for the real AMap Web Service provider
  • extend scripts/check-deployment.sh to detect stale map-service JARs, reverse-geocode failures, missing keys, and accidental Demo Provider fallback
  • document the correct backend/pom.xml clean-build/restart flow and the “map renders but current location fails” diagnosis
  • update AGENTS.md with the S45 live incident, fix, validation, and remaining runtime work

Live verification

  • before: the running map-service returned 404 for /api/maps/cities, while the checked-out source already contained the endpoint
  • after: map-service rebuilt cleanly, restarted active, /api/maps/cities returned 200, and demoProvider=false
  • Chrome simulated-user flow now grants geolocation, resolves the current location through the backend, closes the picker, and updates the map marker

Validation

  • bash -n scripts/check-deployment.sh
  • git diff --check
  • intended-file scan: 0 matches for the real server key
  • ./scripts/verify.sh: 293 backend tests; both frontend typechecks and production builds passed

Remaining

  • full 14-service demo-smoke.sh regression on a sufficiently provisioned host
  • SSE concurrency test on staging only

llfzzz and others added 2 commits July 20, 2026 21:42
…a keyless bundle

Reported from a real server deploy: pulled the repo, restarted, still no map.

Two causes, and the first one is mine:

1. The repo-root .env.example advertised VITE_AMAP_JS_KEY, but Vite reads env files from
   apps/user-h5/ only (vite.config.ts: loadEnv(mode, appRoot)). Every other variable in this
   project lives in the root .env, so that is exactly where someone would put it — and it is
   silently ignored there. The example file now says plainly that it does not belong there and
   names the two places it does.

2. VITE_* is injected at BUILD time, so `git pull` plus a service restart cannot pick it up.
   The H5 must be rebuilt and dist/ redeployed. Now documented in an operations runbook.

The build itself no longer stays quiet about it: a production build with no key prints a
warning naming the file to set and the exact command to use. Previously it produced a bundle
whose map could only ever say "not configured", with the symptom (no map on the server)
appearing far from the cause (an env var in the wrong file).

vite.config.ts also accepts process.env.VITE_AMAP_JS_KEY so CI and server builds can use
`VITE_AMAP_JS_KEY=... pnpm build` without writing a file.

Verified both directions: building without the key fires the warning and greps 0 occurrences
out of dist/; building with it exported greps exactly 1.

The key remains absent from git history and .env.local stays gitignored — confirmed with
`git log --all -S`. That is deliberate per the AGENTS.md secrets baseline; it must be supplied
on the server, not committed.

Verification: ./scripts/verify.sh green — 293 backend tests, 13 Playwright specs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@llfzzz
llfzzz marked this pull request as ready for review July 20, 2026 15:54
Copilot AI review requested due to automatic review settings July 20, 2026 15:54
@llfzzz
llfzzz merged commit 1b49f32 into main Jul 20, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@llfzzz
llfzzz deleted the claude/amap-real-provider-verification branch July 20, 2026 15:54
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.

2 participants