Repository navigation
fix(profile): TASK-25239 residence reorder keeps the verified country when /users/me omits declared - #4196
Conversation
…omits declared, so the drawer sends the swap itself; tests now use the shape the compact API sends
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
/chip review |
There was a problem hiding this comment.
Chip review — INCOMPLETE · no blocking findings — this is not an approval
⚠️ This review is incomplete. The third opinion (product truth, tests, contract) did not run — claude-api_error (after a retry; first: claude-api_error). The copy check did not run — claude-api_error (after a retry; first: claude-api_error). Its questions are unanswered, not answered clean. Comment/chip reviewto run it again.
No findings.
Checked clean
- Exact head and merge base verified; changed reorder request and compact-profile cases reviewed.
- API projection omits declared when it matches verified; residence update carries the requested second country into the pending change.
- Drawer caller, server-first second residence fallback, and design-system impact checked; no visible UI change.
- Exact-head CI checks, including unit, typecheck, lint, and design lint, succeeded.
Security review by moonshotai/kimi-k3: 0 finding(s), marked with the model name. It reads the diff only and answers only security, privacy and money, so treat its findings as advice.
Third opinion: did not run — claude-api_error (after a retry; first: claude-api_error). This review is one reviewer short.
Copy check: did not run — claude-api_error (after a retry; first: claude-api_error). This review is one reviewer short.
Exact head: 021933b4dab9 · Context: repo, design, sibling-api · Took 1m
Summary
The Profile residence drawer swaps the pair when a user picks their own second country. It decided "reorder" from
declared, but the compact/users/meomitsdeclaredwhen it equals the verified country (apiresidence-profile.ts:114-115). So a verified user with a second country sent onlyresidenceCountry, and the API wrote the second country into both slots on GREEN. The outgoing primary is nowdeclared ?? verified.TLC trace:
_Buggyin monoengineering/api/state-machines/ResidenceChange.tla(6 steps,SecondaryDistinct).The API owns the fix: peanut-api-ts#2202 makes
/update-userkeep the outgoing country, which also covers installed clients. This PR makes the drawer send the swap itself and makes its tests honest: they rendereddeclared: 'ES', verified: 'ES', a shape the API never sends.Task
TASK-25239
Risks / contract
No API contract change; the request already carries
secondResidenceCountry. Ships independently of api#2202 in either order. Result with either side alone: the pair is swapped.Tests
ResidenceChangeDrawer.test.tsx: the 5 reorder cases now render the compact shape (declared: null, verified: 'ES'). On the old drawer 3 of them fail; with the fix all 24 pass.agent-nice --heavy, one worker):src/components/Profile(15 suites, 299 tests). Typecheck and the full suite run in CI. This base (feat/state-machine-hardening) does not triggertests.ymlonpull_request, so CI ran byworkflow_dispatch.Screenshots
N/A (no visible change: the request body changes, the screen does not).