-
-
Notifications
You must be signed in to change notification settings - Fork 963
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
fix: do not invalidate recovery addr on update #2699
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2699 +/- ##
==========================================
+ Coverage 75.13% 75.17% +0.04%
==========================================
Files 293 293
Lines 16740 16792 +52
==========================================
+ Hits 12578 12624 +46
- Misses 3197 3200 +3
- Partials 965 968 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the quick turnaround! We have the problem both in recovery as well as verification :) It would also be awesome if we could write a small test to ensure that the diff is working correctly. Speaking about this, it's not uncommon that we need to check whether a 1:n
relationship has changed in Ory Kratos (same goes for credentials for example) so maybe we can generalize this problem using a (potentially generic) diff function to return the IDs that need to be removed and inserted?
000fd69
to
ee917e7
Compare
@aeneasr all review comments addressed. As far as the test for the verified address go, the suite is very thorough: Lines 555 to 719 in bece076
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job :)
This PR modifies persister.UpdateIdentity to only update the recovery addresses that changed, leaving the unchanged once (and their associated recovery tokens) valid.
Shout-out to @thcyron for the analysis.
Fixes #2433
TODO