User settings don't persist: profile changes stale after save, client preferences not stored #36
Labels
No labels
area:api
area:core
area:docs
area:infra
area:ux
dependencies
documentation
duplicate
good first issue
help wanted
invalid
question
rust
status:complete
status:partial
status:planned
type:bug
type:design
type:feature
type:infra
type:refactor
type:research
type:ux
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
icub3d/decentcom#36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Migrated from GitHub issue icub3d/decentcom#41
Original Author: @icub3d
Original Date: 2026-04-15T20:54:57Z
Summary
User settings don't persist correctly in two areas: profile changes (display name, avatar) and client-side preferences (e.g., theme).
Bug 1: Profile changes appear stale after saving
Root cause
ProfileEditorcalls the server API (updateProfile,uploadAvatar,deleteAvatar) and the server returns the updatedMemberobject, but the result is never applied back touseMembersStore. The local store stays stale until the nextconnect()reloads members from the server.This means:
useMembersStore(e.g.Avatar,ProfilePopover) shows the stale value until reconnect.The
useMembersStoredoes handleMEMBER_UPDATEgateway events, so the store will eventually update if the server broadcasts the event — but this is not guaranteed to happen synchronously, and theProfileEditorshouldn't rely on it.Fix
Add an
updateMemberProfile(userId, patch)action touseMembersStorethat optimistically updatesdisplay_nameand/oravatar_hashfor a given user. Call it inProfileEditorafter each successful save, using theMemberreturned by the API.Files to change:
client/src/stores/members.ts— addupdateMemberProfileactionclient/src/components/profile/ProfileEditor.tsx— callupdateMemberProfileafterupdateProfile,uploadAvatar, and setavatar_hash: nullafterdeleteAvatarBug 2: Client-side preferences not stored as part of identity
Context
The theme is currently stored in two separate
localStoragekeys:decentcom-theme(written bysaveThemeinapply.ts)decentcom-app-storage(written by zustandpersistmiddleware inappStore.ts)This dual-write is redundant and can lead to subtle divergence.
More importantly, client-side preferences (theme, UI density, notification settings, etc.) are not stored alongside identity. If a user's Tauri data directory is reset or they move to a different device, all preferences are lost.
Recommendation
saveTheme/loadThemelayer and rely solely on zustandpersist, or vice versa).UserPreferencestype inshared/orclient/that captures all client-side settings.storeplugin (or a Tauri IPC command backed by a file) so they survive WebView cache clears and are co-located with identity data.Files to consider:
client/src/theme/apply.tsclient/src/stores/appStore.tsclient/src-tauri/(Tauri core — for a Tauri-backed persistence option)docs/design/identity.md— document the decision on where client prefs liveSteps to reproduce Bug 1