mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4867] [Issue]: Undated local UI settings can overwrite server preferences #2694
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#2694
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?
Originally created by @Xelvanis on GitHub (Aug 10, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4867
Originally assigned to: @SpicyMarinara on GitHub.
Summary
A browser-local UI settings blob with no trustworthy
marinara-engine-ui-updated-attimestamp can be stamped as current during startup and replace the server's complete synced UI settings profile. This can silently revert unrelated cross-device preferences to stale local values.Expected behavior
When a local UI settings cache has no valid timestamp and a server UI settings blob exists, server-present keys should remain authoritative. Local values should be used only for keys missing from the server, after which the merged complete profile can be rewritten with a current timestamp.
Existing behavior should remain unchanged when the local timestamp is valid or when no server settings blob exists yet.
Actual behavior
useSettingsSyncdetermines that an undated local profile is customized, assigns itDate.now()before reading the server, and then treats it as newer than a dated server profile. The local-wins branch callspushNow(), which serializes and PUTs the entire localpickSyncedSettingsprojection. The server stores the UI settings as one opaque replacement value, so unrelated server-present preferences are overwritten rather than merged.This is a pre-existing compatibility/recovery issue and is not caused by adding
enterToSendGameto the synced projection.Steps to reproduce
app_settings.uiprofile containing a finite__updatedAtand at least one customized shared preference.marinara-engine-uilocal-storage blob whose companionmarinara-engine-ui-updated-atkey is absent or invalid.app_settings.uivalue.A long-unopened pre-timestamp browser can reach this path after current UI-store migration. Other plausible triggers are restoring the UI local-storage blob without its companion timestamp or selective storage corruption/cleanup.
Environment
stagingcommit5732c27c9acccaa22498ecea58afd715a97886dcLogs, screenshots, or video
No runtime logs or screenshots. The issue was established through bounded source/history tracing and prior real-store hydration/projection probes.
Relevant code paths:
packages/client/src/hooks/use-settings-sync.tsreadLocalUpdatedAt()returnsnullfor missing/invalid values.Date.now()when local state is customized but undated, before fetching server settings.localIsNewerthen selectspushNow().pushNow()PUTs the completepickSyncedSettingsprojection.packages/server/src/routes/app-settings.routes.tsPUT /app-settings/:keyaccepts and stores the complete opaque value.packages/server/src/services/storage/app-settings.storage.tsset()replaces the stored value for the key.Additional context
The realistic blast radius is one user's cross-browser UI preferences, including appearance and synchronized input/chat/image/player preferences. Chats, messages, characters, personas, lorebooks, and other content are not overwritten.
The original pre-timestamp cohort is shrinking because a successful modern startup writes the timestamp. The path remains plausible for long-unopened browsers, selectively restored backups, or loss of the companion timestamp key.
Suggested bounded repair:
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: