Skip to content

Report preferences that were not saved - #729

Merged
blaipr merged 1 commit into
mainfrom
fix/preferences-report-when-nothing-changed
Aug 13, 2026
Merged

Report preferences that were not saved#729
blaipr merged 1 commit into
mainfrom
fix/preferences-report-when-nothing-changed

Conversation

@blaipr

@blaipr blaipr commented Aug 13, 2026

Copy link
Copy Markdown
Member

The bug

UserService::updatePreferencesById() discarded the row count it got back, so a save whose WHERE matched 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:

  • the service raises when the update affected nothing;
  • the page answers with the failure and leaves the session untouched, which is the part that made this one worse than its siblings.

Unit suite green: 3082. The preferences class: 6 green.

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.
@blaipr
blaipr merged commit b25951f into main Aug 13, 2026
8 checks passed
@blaipr
blaipr deleted the fix/preferences-report-when-nothing-changed branch August 13, 2026 22:06
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.

1 participant