Skip to content

🐛 fix(user-state): include notification settings in getUserState#14257

Merged
tjx666 merged 1 commit into
canaryfrom
fix/user-state-include-notification
Apr 28, 2026
Merged

🐛 fix(user-state): include notification settings in getUserState#14257
tjx666 merged 1 commit into
canaryfrom
fix/user-state-include-notification

Conversation

@tjx666

@tjx666 tjx666 commented Apr 28, 2026

Copy link
Copy Markdown
Member

💻 Change Type

  • 🐛 fix

🔀 Description of Change

UserModel.getUserState selects every settings column except notification. The column is correctly written by updateSetting, but the read path silently drops it, so data.settings.notification is always undefined after refresh. The notification settings page then re-renders with DEFAULT_NOTIFICATION_SETTINGS, making it look like the user's toggle was never saved.

Add settingsNotification: userSettings.notification to the select list and surface it as settings.notification in the returned state.

🧪 How to Test

  1. Open /settings/notification (cloud app).
  2. Toggle any switch (channel master switch or per-type switch).
  3. Reload the page.
  4. Before this fix the switch reverts to the default; after this fix the saved value is preserved.
  • Tested locally
  • Added/updated tests
  • No tests needed

The notification column existed in user_settings schema and was being
written by updateSettings, but getUserState's select query never read
it back. As a result, after refresh the notification settings page
displayed the default (defaults from DEFAULT_NOTIFICATION_SETTINGS)
instead of the user's saved values.

Add `settingsNotification` to the select and surface it as
`settings.notification` in the returned state.
@vercel

vercel Bot commented Apr 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Building Building Preview, Comment Apr 28, 2026 3:29am

Request Review

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 28, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

@tjx666 tjx666 merged commit 47812b2 into canary Apr 28, 2026
35 of 37 checks passed
@tjx666 tjx666 deleted the fix/user-state-include-notification branch April 28, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant