-
-
Notifications
You must be signed in to change notification settings - Fork 69
Verification Emails are triggered every time User.current is saved #239
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Thanks for opening this issue!
|
In the JS SDK, are you able to show where the following occurs:
That will provide some guidance on where this is happening on the client level, or if the server is actually handling it. |
I'm probably not familiar enough with the JS SDK to point where exactly it happens, but my understanding is that I would assume it's _getSaveJSON, which determines what JSON objects need to be sent to the server, only if they have been mutated. |
Another way to replicate this is to have a simple |
I see, this may be the reason. Since ParseSwift uses structs it doesn't have getters/setters and doesn't have a notion of dirty. If the PR I just openned doesn't work, I think I may have a solution. |
Thank you for your help @cbaker6, it is much appreciated. The issue still occurs on that branch too. emailVerified isn't showing up in either master or this branch as a dirtyKey, the dirtyKeys are set as I'm assuming the emailVerified is being triggered by server thinking |
Some alternative options to make sure dirtyKeys is passed properly:
Option 1 would require every class which is used in Parse Swift to have a beforeSave trigger. Option 2 would require server changes and no Parse Swift changes. |
@dblythy thanks for reporting! I believe the linked PR fixes the issue you found. |
New Issue Checklist
Issue Description
Parse Swift triggers email verification whenever
User.current?.save
is called.Steps to reproduce
verifyUserEmails
on.User.current
Actual Outcome
Emails are sent every time user is updated
Expected Outcome
Emails to only send on #, or email update, as per the SDK.
Specifically, the issue seems to be related to here o the server:
For the JS SDK,
this.data.email
is undefined on any update. For Parse Swift calls, this.data.email is passed.Environment
Client
1.9.10
10.15.7
iOS
14.3
Server
Master (around 4.5.0
macOS
local
Database
mongoDB
4.4
Atlas
Logs
The text was updated successfully, but these errors were encountered: