Context
Found in the review runs for PR #1275 (Codex logic lane). Pre-existing on develop — the block is outside every hunk of that PR, so it is reported rather than fixed there.
Evidence
src/screens/payment-link.screen.tsx (~157-172): the wallet-id effect calls getDeeplinkByWalletId(wallet.id) and writes in .then/.finally without a generation token or a mounted check.
- On a fast switch of
wallet-id, a late response for wallet A can call setWalletData({ ...A, deepLink }) after B was selected.
- Its
finally deletes the wallet-id parameter of the current state and clears isLoadingDeeplink, so the newer request loses its own URL parameter and its spinner.
Fix direction
Generation counter in a useRef, incremented per request and on unmount; apply state and URL updates only for the current generation. Precedent in this repository: src/hooks/safe.hook.ts:181-224, buy.screen.tsx.
Related
Context
Found in the review runs for PR #1275 (Codex logic lane). Pre-existing on
develop— the block is outside every hunk of that PR, so it is reported rather than fixed there.Evidence
src/screens/payment-link.screen.tsx(~157-172): thewallet-ideffect callsgetDeeplinkByWalletId(wallet.id)and writes in.then/.finallywithout a generation token or a mounted check.wallet-id, a late response for wallet A can callsetWalletData({ ...A, deepLink })after B was selected.finallydeletes thewallet-idparameter of the current state and clearsisLoadingDeeplink, so the newer request loses its own URL parameter and its spinner.Fix direction
Generation counter in a
useRef, incremented per request and on unmount; apply state and URL updates only for the current generation. Precedent in this repository:src/hooks/safe.hook.ts:181-224,buy.screen.tsx.Related