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

Implement feature that allows denormalization of vote counts #44

Merged
merged 18 commits into from
Jun 1, 2021

Conversation

lilsweetcaligula
Copy link
Collaborator

@lilsweetcaligula lilsweetcaligula commented May 18, 2021

#43

Tests fail because the version of mem-store which supports upserts has not been released yet. When run against the latest mem-store via npm link, all tests pass:

$ npm run test

> seneca-vote@1.0.1 test
> ./node_modules/jasmine/bin/jasmine.js --config=test/support/jasmine.json

Randomized with seed 72004
Started
...................................................


51 specs, 0 failures
Finished in 1.979 seconds
Randomized with seed 72004 (jasmine --random=true --seed=72004)

@lilsweetcaligula lilsweetcaligula self-assigned this May 18, 2021
const vote_code = fetchProp(safe_params, ['fields', 'code'])

// TODO: Implement transactions.
//
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For example, currently if the plugin crashes when trying to de-normalize a poll rating, the submission of the vote will not be rolled back (i.e. undone). This violates ACID and must be handled via implementation of a transaction.



function getEntityInfoForSave(args, _ctx, opts) {
Assert.object(opts, 'opts')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should we, perhaps, implement validation of the plugin options, passed to the plugin by the client? Such validation would be implemented in index.js, and make sure client passes supported well-formed options.

@lilsweetcaligula lilsweetcaligula merged commit c932da0 into master Jun 1, 2021
@lilsweetcaligula lilsweetcaligula deleted the denormalize-vote-counts branch June 1, 2021 23:35
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.

1 participant