Skip to content

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

Merged
flovilmart merged 5 commits into
masterfrom
issue/3850
May 29, 2017
Merged

Use RestWrite when verifying emails so hooks are called (as master)#3851
flovilmart merged 5 commits into
masterfrom
issue/3850

Conversation

@flovilmart
Copy link
Copy Markdown
Contributor

fixes #3850

@codecov
Copy link
Copy Markdown

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
Copy Markdown
Contributor

Is there a way to add a test for this?

@flovilmart
Copy link
Copy Markdown
Contributor Author

Yep!

Copy link
Copy Markdown
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....


const transformValue = value => {
if (value.__type === 'Pointer') {
if (typeof value == 'object' &&
Copy link
Copy Markdown
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 :)

Comment thread src/RestWrite.js
}

if (this.query) {
// Do not cleanup session if objectId is not set
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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