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

Use RestWrite when verifying emails so hooks are called (as master) #3851

Merged
merged 5 commits into from
May 29, 2017

Conversation

flovilmart
Copy link
Contributor

fixes #3850

@codecov
Copy link

codecov bot commented May 23, 2017

Codecov Report

Merging #3851 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3851      +/-   ##
==========================================
+ Coverage   90.14%   90.21%   +0.06%     
==========================================
  Files         114      114              
  Lines        7550     7549       -1     
==========================================
+ Hits         6806     6810       +4     
+ Misses        744      739       -5
Impacted Files Coverage Δ
...dapters/Storage/Postgres/PostgresStorageAdapter.js 95.46% <100%> (ø) ⬆️
src/Controllers/UserController.js 92.98% <100%> (+0.74%) ⬆️
src/RestWrite.js 93.26% <100%> (+0.39%) ⬆️
src/Routers/ClassesRouter.js 93.05% <100%> (+0.09%) ⬆️
src/rest.js 97.01% <100%> (ø) ⬆️
src/Adapters/Cache/InMemoryCache.js 100% <0%> (+7.69%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f11ad5...a87f5e1. Read the comment docs.

@natanrolnik
Copy link
Contributor

Is there a way to add a test for this?

@flovilmart
Copy link
Contributor Author

Yep!

Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

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

looks good. I put a question in there....

@@ -58,7 +58,8 @@ const toPostgresValue = value => {
}

const transformValue = value => {
if (value.__type === 'Pointer') {
if (typeof value == 'object' &&
Copy link
Contributor

Choose a reason for hiding this comment

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

may as well go === for consistency :)

@@ -354,7 +354,8 @@ RestWrite.prototype.transformUser = function() {
throw new Parse.Error(Parse.Error.OPERATION_FORBIDDEN, error);
}

if (this.query) {
// Do not cleanup session if objectId is not set
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm. what could go wrong? sorry for not knowing, but what does this solve?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That matches all sessions with _User id undefined, which is not cool :)

@flovilmart
Copy link
Contributor Author

@acinader @natanrolnik so I went a bit ahead, and made rest.update work with a full query object (maybe @TylerBrock will like that for the updateWhere :)). This allows the guaranteed that all hooks will be properly called (beforeSave, afterSave and liveQuery) for this update.

@flovilmart flovilmart merged commit c2abbae into master May 29, 2017
@flovilmart flovilmart deleted the issue/3850 branch May 29, 2017 00:34
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.

Email verification does not trigger LiveQuery event
3 participants