Skip to content

Conversation

@danrparker
Copy link
Contributor

Description

This pull request makes a small change to the vote submission logic in the elections-vote.ce.vue component. Instead of redirecting the user to the elections page after submitting a vote or spoiled vote, it now logs a message to the console indicating successful submission.

  • Replaced the delayed redirect to /elections with a console log message upon successful vote or spoiled vote submission in elections-vote.ce.vue. [1] [2]

Checklist

  • I accept the contributor license agreement for this repository.
  • All active GitHub checks for tests, formatting, and security are passing.
  • The correct base branch is being used (if not main).
  • A GitHub issue or linear task is linked to this pull request.

@danrparker danrparker requested a review from a team as a code owner January 27, 2026 13:56
@linear
Copy link

linear bot commented Jan 27, 2026

setTimeout(() => {
window.location.assign("/elections");
}, 3500);
console.log("Vote submitted successfully");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: After a vote is submitted, the component state is not cleared and no success feedback is shown, allowing the user to immediately resubmit the same vote.
Severity: HIGH

Suggested Fix

In the .then() block of the submitVotes function, add logic to provide clear success feedback to the user. This could involve displaying a success message, clearing the component's state by calling this.clearVotes(), and/or redirecting the user to a confirmation page, similar to the previous behavior.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/components/elections-vote/elections-vote.ce.vue#L375

Potential issue: After a user successfully submits a vote via the `submitVotes`
function, the component's state is not cleared, and no visual feedback is provided to
the user. The previous redirect logic was removed but not replaced. As a result, the
submission modal closes after a timeout, returning the user to the voting page with
their previous selections still active and all buttons re-enabled. This can lead to user
confusion about whether the vote was successful and allows them to immediately resubmit
the same vote.

Did we get this right? 👍 / 👎 to inform future reviews.

@danrparker danrparker merged commit b081f51 into main Jan 27, 2026
8 checks passed
@danrparker danrparker deleted the dparker/web-557 branch January 27, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants