Report preferences that were not saved - #729
Merged
Merged
Conversation
The preferences page discarded the row count its own update returned, so a save whose WHERE matched nothing — the user's row deleted from another session — reported success. Worse than the other six services that did this: the caller then refreshed the session with the preferences it thought it had stored, so the page went on showing settings that exist nowhere until the next sign-in threw them away. This is the check the six others got; the preferences path was simply missed. Covered at both ends: the service raises when nothing was affected, and the page reports the failure and leaves the session alone.
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.
The bug
UserService::updatePreferencesById()discarded the row count it got back, so a save whoseWHEREmatched nothing — the user's own row deleted from another session — reported success.Worse than the six services fixed in #719: the controller then refreshed the session with the preferences it believed it had stored, so the page went on showing settings that exist nowhere, until the next sign-in threw them away and silently reverted everything.
This is the same check those six got. The preferences path was simply missed — my omission, from the same batch.
Testing
Both ends:
Unit suite green: 3082. The preferences class: 6 green.