Client Local User Preferences And Account Sync
Client-local user preferences store runtime settings that must be available before account services or multiplayer state are connected. Account preference tables store server-side preferences that can later be synchronized.
How It Works
runtime_user_preferences.json is a versioned local document written through the client local persistence layer. Writes are atomic and incompatible or damaged documents can be moved aside for recovery. Accessibility state also has an account-level SQL shape for multiplayer preferences and future sync.
How To Use It
Use client-local preferences for input, standalone behavior, accessibility choices needed at boot, and local UI state. Use account preferences for server-backed social, accessibility, or cross-device choices.
When adding a setting, decide whether it must work offline, whether it should sync between machines, and what the migration path from local to account-backed should be.
Invariants
Local document versions must be forward-compatible or explicitly recoverable. Atomic writes should preserve the last good preferences file. Account sync must not overwrite local boot-critical settings before the user has a chance to load the client.
Debugging
Broken JSON, incompatible document versions, recovery directory writes, and mismatches between local accessibility state and SQL account preferences are the main issues. If UI state appears to reset, inspect both local persistence and account sync writes.