You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Review vote rollback overwrites votes on other reviews #799
handleVote in apps/web/src/components/reviews/JReviewsSection.tsx snapshots the whole userVotes map (votesBefore = userVotes) and restores it on a refused vote. pendingIds only locks the clicked review, so a reader can vote on review B while A's request is in flight. The last rollback to run writes back a stale copy of the whole map to state and rate_review_votes_v1:
A and B both refused (403/429): A's refused vote is re-highlighted and stored although its count was rolled back; A's next click sends clear.
A refused, B accepted, A's response last: B's saved vote is wiped locally; B's next click sends up again.
The optimistic update (updatedVotes = { ...userVotes }) builds from the same render-time copy.
Fix: roll back and apply only the clicked review's entry with functional state updates.
Acceptance: an E2E test that votes on two reviews while the first request is pending, refuses both, and expects neither to stay highlighted or stored; the existing rollback spec stays green.
[Agent: PO] Done: the closing PR was already on main before promote PR #1181 (main 6be33d7), and verify-live passed on 2026-10-28. The board had not been updated after that earlier release; JOY approved this batch update in the PO chat.
Activity
test(web): assert the in-flight vote survives a sibling rollback (#799)
fix(web): roll back only the refused review's vote (#799) (#803)
JOY commentedon Oct 28, 2026
[Agent: PO] Done: the closing PR was already on main before promote PR #1181 (main 6be33d7), and
verify-livepassed on 2026-10-28. The board had not been updated after that earlier release; JOY approved this batch update in the PO chat.