Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 013d63c5-2539-4aba-a3eb-fddc824bcffc) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3f0de5255
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| async (response) => { | ||
| const session = await getCurrentSession(); | ||
| requireSameAccount(response.config, session?.user.id ?? null); | ||
| return response; |
There was a problem hiding this comment.
Prevent committed responses from triggering local fallbacks
If a player switches accounts while collect is in flight, Flask can commit the collection before this post-response identity check rejects the successful reply. BlockModeView.handleCollect treats every rejection as an offline failure and calls collectIncome plus vaultDeposit, so Alice's server-side collection can be followed by a local collection in Bob's still-mounted, persisted stores. Return a distinct non-fallback result for post-commit account changes, or cancel/reset consumers on the auth transition so a committed mutation cannot enter the offline path.
AGENTS.md reference: AGENTS.md:L12-L15
Useful? React with 👍 / 👎.
|
Integration-owner handoff from the 2026-10-15 ten-PR audit: please retain ownership of this auth slice and address the existing unresolved P1 review (#206 (comment)) before integration, with a regression for the committed collect/account-switch failure path. I have not edited this branch or the overlapping ATTACK/BlockModeView files. Manus PR #209 is an independent inventory/TRAP/demo-reseed repair with no runtime-file overlap. #175 still needs the separately approved staging two-user/reload/second-session proof; nothing here was treated as beta or production authorization. |
A committed or rejected collect was treated as an offline failure and paid the local owner still mounted. Account changes now stay out of that fallback, and a double tap applies one collection. Co-authored-by: yourbranddead <yourbranddead@gmail.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: fef698b3-31e4-41e0-9456-cbd3ee1e444a) |
Outcome
Flask API requests now follow the Supabase session used by the existing login screen, including current token/account changes and SDK-managed refresh. Pending requests cannot replay or deliver an old-account response after the account changes.
Scope
In:
frontend/src/services/api.service.ts, its new 16-case auth regression suite, a dated project-log entry, and text verification underdocs/evidence/2026-10-14-current-auth-api/.Reserved files: the two API/test files above; project log is append-only. No existing #204/#205/#202/#169 implementation file is changed.
Contracts preserved
Verification
9eef5aa: 12 failed / 4 passed; corrected source: 16 passed.248ad40a80aa33a955fc213143a043d4a6a30057. Published exact-head CI passed onc3f0de5: 1,049 frontend tests passed / 4 existing skips; 107 unchanged-backend tests passed; type/lint/assets/packages/build passed. Vercel preview status is Ready.Diagnostics and limits
Lazy SDK loading adds a recorded Rollup advisory because the app also imports that module statically; no second client or separate chunk is created. Existing legacy-image references and large-chunk warnings remain. Live #175, physical-device performance and human PvP are unproven by this PR.
Operational impact
No backend, schema, RLS, credentials, scheduler, production or deployment change. Revert this focused PR for source rollback.
Integration notes
Refs #175; closes nothing. Independent of #204, #205, #202 and #169. Preserve every dated project-log addition during integration. No merge or deployment is requested.
Review availability
Independent local review is complete. GitHub Codex code review is running; security review is completed. No inline review threads were present at this check. Cursor Bugbot could not run because its usage/spend limit was reached; no budget setting was changed. This is not a merge or release approval.
Note
Medium Risk
Client auth and token-refresh behavior changed for all Flask traffic, and block collection economy paths were altered; risk is mitigated by broad regression tests but session edge cases still warrant review.
Overview
Flask HTTP calls now attach the active Supabase SDK session (lazy-loaded) instead of legacy
localStoragetokens, with SDK-managed refresh, shared concurrent 401 refresh, and guards that block delivering or replaying responses/mutations after sign-out or account switch viaAccountChangedError.Block income collection no longer treats those account-change failures as offline: it skips vault deposit and pending-income clear, shows an account-changed toast, and adds in-flight/double-tap protection while same-account offline collect still pays once.
Adds 16 API auth regressions and 4
BlockModeViewcollect/account-switch tests, plus dated project-log and evidence docs. Frontend-only; no backend or deploy changes.Reviewed by Cursor Bugbot for commit 7e75c3c. Bugbot is set up for automated code reviews on this repo. Configure here.
Outcome
Flask API requests follow the Supabase session used by the existing login screen, including current token/account changes and SDK-managed refresh. Pending requests cannot replay or deliver an old-account response after the account changes.
A collection that finishes during an account switch no longer pays the local owner who is still mounted.
P1 repair (2026-10-16)
Codex review on
c3f0de5(discussion): ifcollectis in flight and the account changes, Flask can commit before the post-response identity check rejects the success.BlockModeView.handleCollecttreated every rejection as offline and calledcollectIncomeplusvaultDeposit, so the mounted save received a second payout.Fix: account changes reject with
AccountChangedError(including a 401 whose refresh would land on another user, and sign-out). The collect handler does not deposit or clear pending income for that error. A same-tick double tap sends and applies one collection. A same-account network failure still collects locally once.Regression: on unchanged
c3f0de5the new suite failed because the mounted owner was paid$250and a double tap sent two collects. After7e75c3cit passes.Scope
In:
frontend/src/services/api.service.ts,frontend/src/components/map/BlockModeView.tsx,frontend/src/services/__tests__/api.service.auth.test.ts,frontend/src/components/map/BlockModeView.collectAccount.test.tsx, a dated project-log entry.Out: #175 two-user staging proof, #209 inventory, DRIVE, ATTACK, backend, schema, RLS, secrets, Vercel env, production Supabase.
Reserved files: the API client, BlockModeView collect path, and the two test files above. Project log is append-only.
Contracts preserved
Verification
BlockModeView.collectAccount.test.tsxfailed: committed collect and post-switch 401 each deposited$250into the mounted owner and cleared pending income; a double tap called collect twice.tsc --noEmitclean. Touched-file eslint clean (removed the unusedplayer.bankBalancedependency on the edited collect callback). The pre-existing repo lint errors were not part of this change.7e75c3c: run 38958921461 — Frontend (lint + build) success, Backend (pytest) success. Vercel preview status success. Cursor Bugbot neutral.Operational impact
No backend, schema, RLS, credentials, scheduler, production, or deployment change. Revert this focused PR for source rollback. Pushing the existing PR branch lets the already-connected preview workflow rebuild; nothing was promoted.
Integration notes
Refs #175; closes nothing. Independent of #204, #205, #202, #169, and #209. Preserve every dated project-log addition during integration. Block and shoebox stores are still not reset on account switch; this repair only stops the in-flight collect from paying the mounted owner. No merge or deployment is requested.