Repository navigation
refactor(auth): settings share how they store a picture, find an event and record a verification - #563
Merged
Conversation
…t and record a verification
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…hat record_verified records
PiquelChips
marked this pull request as ready for review
November 20, 2026 08:06
PiquelChips
marked this pull request as draft
November 21, 2026 14:00
PiquelChips
marked this pull request as ready for review
November 21, 2026 14:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #544
Three account settings each wrote one step twice, so a reader had to compare the copies to see that they do the same thing:
set_pictureandimport_pictureboth stored the JPEG under a new ID and recordedPictureChanged. They now shareAccountService::store.HistoryItem::find(a notification's history entry) andAccountService::entry(a report) both built the same one-event filter and took its result. They now shareHistoryItem::stored.verify_emailandAdded::verified(a provider's or invitation's address) both recordedEmailVerified, thenPrimaryEmailChangedwith no previous address. They now shareEmailApplication::record_verified, which records the second event only when the address became primary.Unchanged: each operation runs the same statements in the same order, inside the same transaction and under the same locks, and records the same events in the same order. Errors keep their types and variants (
DatabaseErrorreachesAccountError::DatabaseorEmailError::Databaseas before), so HTTP responses don't change. The one reordering:set_picturenow draws its randomPictureIdafter taking the lock instead of before. Nothing reads the ID first.Tests: none merged or removed. Files outside my area: none.
Checks:
just fmt;cargo clippy -p auth-service --all-targetswith and without--all-features(-D warnings);cargo doc -p auth-service --all-features(-D warnings);just rust unused;just db prepare-check.just db test --no-fail-fast: 495 of 497 passed.keys::tests::rewrapping_seals_every_key_under_the_current_key_encryption_keyandkeys::tests::rotation_takes_each_step_once_on_schedulehit a statement timeout on the signing-key lock while the machine's load average was about 70. All 9keys::tests pass when run alone (just db test -E 'test(/^keys::/)'), the whole suite passed on the same base in #554, and this diff doesn't touchkeys.Note
Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)