voting does not reflect changes on result app.
See original GitHub issuecloned the repo, ran docker-compose up.
on voting, the logs gives
vote_1 | 10.0.19.2 - - [22/Dec/2016 20:04:10] "POST / HTTP/1.1" 200 -
worker_1 | Processing vote for 'a' by 'cceb022e236a011b'
db | ERROR: duplicate key value violates unique constraint "votes_id_key"
db | DETAIL: Key (id)=(cceb022e236a011b) already exists.
db | STATEMENT: INSERT INTO votes (id, vote) VALUES ($1, $2)
also it does not reflect any change on the result app , even when voting for the first time.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
What 2020's Election Poll Errors Tell Us About the ...
Most preelection polls in 2020 overstated Joe Biden's lead over Donald Trump in the national vote for president, and in some states ...
Read more >Frequently Asked Questions - California Secretary of State
Voter Registration. Who can register to vote? To register to vote in California, you must be: A United States citizen and a resident ......
Read more >All Frequently Asked Questions for Elections | Tennessee ...
Frequently Asked Questions for this Division. Absentee Voting. Can I hand deliver my ballot to the election office?
Read more >Title 52- Voting and Elections- Subtitle I and II
(1) All citizens of the United States who are otherwise qualified by law to vote at any election by the people in any...
Read more >How to register to vote | USAGov
Use vote.gov to register to vote in federal, state, and local elections. If you're a U.S. citizen living abroad, see how you can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The duplicate key error occurs when you try to vote more than once from the same client. Each vote is inserted into the database using a cookie generated by the vote application. When you try to vote from the same client it will use the same id from the cookie which violates the duplicate key constraint in the database. Will not fix.
I upgraded to postgres 9.6 and am now using the upsert functionality.
I think that may not be the issue, however, as the exception should be caught in the code and the update should happen. One issue I found is that the results app is not really connecting to postgres because of this in result/server.js:
I changed this and also modified the getVotes function and it is all working:
And in result/views/app/js