Skip to content

Review vote rollback overwrites votes on other reviews #799

Closed

Description

@JOY

Found in a post-merge review of #792 (#790).

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.

Activity

  1. added
    bugSomething isn't working
    agent:brandClaimed by Agent: Brand
    status:in-progressTask currently claimed and being worked on by an Agent
    status:in-reviewTask completed and waiting for review / PR merge
    and removed
    status:in-progressTask currently claimed and being worked on by an Agent
    on Oct 23, 2026
  2. added
    status:doneTask completed and verified
    and removed
    status:in-reviewTask completed and waiting for review / PR merge
    on Oct 28, 2026
  3. self-assigned this
    on Oct 28, 2026
  4. JOY commented on Oct 28, 2026

    @JOY
    ContributorAuthor

    [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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent:brandClaimed by Agent: BrandbugSomething isn't workingstatus:doneTask completed and verified

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions