Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[models:law] Fixed misused async behavior when voting. Closes #394. #489

Merged
merged 7 commits into from
Dec 11, 2014

Conversation

jfresco
Copy link
Contributor

@jfresco jfresco commented Dec 4, 2014

Note that unvote is async, but it was being used in a sync way. This may have caused race conditions and led to this odd behavior.

@jfresco
Copy link
Contributor Author

jfresco commented Dec 4, 2014

Still working here, don't merge!

@jfresco
Copy link
Contributor Author

jfresco commented Dec 4, 2014

Ready to review & merge. Please comment any issue.

@gvilarino gvilarino self-assigned this Dec 4, 2014
this.votes.push(vote);
// Add citizen as participant
this.addParticipant(citizen);
this.save(cb);
Copy link
Member

Choose a reason for hiding this comment

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

You're missing the if (cb) here

@jfresco
Copy link
Contributor Author

jfresco commented Dec 4, 2014

Done. Check this out now.

@@ -12,6 +12,7 @@

.proposal-options
.vote-box
div#voting-error.alert.alert-warning.hide #{t('Connection error when voting')}.
Copy link
Member

Choose a reason for hiding this comment

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

@jfresco please use i18n keys in the canonical format. In this case I guess proposal-options.error.voting would do

@gvilarino
Copy link
Member

Also, please add i18n keys for all languages. Google translate will do.

jfresco and others added 2 commits December 10, 2014 15:24
Conflicts:
	lib/models/law.js
	lib/proposal-options/proposal-options.js
@gvilarino
Copy link
Member

@jfresco I updated your code to the view refactor approach. I tried it out and seems to be working just fine, but please double-check with your concurrent/error test dataset so we can be sure I introduced no bug and we can go ahead with the merge.

jfresco added a commit that referenced this pull request Dec 11, 2014
[models:law] Fixed misused async behavior when voting. Closes #394.
@jfresco jfresco merged commit 1c0a3af into development Dec 11, 2014
@gvilarino gvilarino deleted the 394-votes-count branch January 7, 2015 00:46
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