settings.toml does not store LocalSettings::chat: chat settings and drafts are lost on restart #371

Open
opened 2026-11-12 23:26:24 +00:00 by charles · 0 comments
Owner

Found in the review of Text chat 19 (PR #350, issue #269). Seen on commit 1630a19 (branch textchat-19-core-dms-settings); the same holds on origin/textchat at b87bcd9.

fluxer-core keeps the machine-local chat state in LocalSettings::chat (LocalChatSettings: settings: ChatSettings, drafts, recent_searches), and its reducers emit PersistOp::SaveSettings with it. But fluxer-platform::settings (settings.toml) never writes or reads a chat section: SettingsFile has no field for it, from_settings drops it and into_settings starts from the defaults. So every local chat setting (all the Advanced chat controls of Text chat 19, convert emoticons, scroll to bottom on send and so on), every draft and the recent searches are lost when the app restarts.

Steps to reproduce:

  1. Run the app, change a local chat setting (for example SetChatSetting(ShowSendButton(true))) or type a draft.
  2. Quit and start the app again.
  3. The setting is back to its default and the draft is gone; settings.toml has no [chat] table.

The core tests (old_settings_files_load, local_chat_settings_defaults_and_persist) only check the SaveSettings effect, so they pass.

To do: add a [chat] table to SettingsFile (all fields serde(default), so files written before text chat still load), map it in from_settings / into_settings, and add a round-trip test in fluxer-platform. Related: #315 (recent searches).

Found in the review of Text chat 19 (PR #350, issue #269). Seen on commit 1630a19 (branch `textchat-19-core-dms-settings`); the same holds on `origin/textchat` at b87bcd9. `fluxer-core` keeps the machine-local chat state in `LocalSettings::chat` (`LocalChatSettings`: `settings: ChatSettings`, `drafts`, `recent_searches`), and its reducers emit `PersistOp::SaveSettings` with it. But `fluxer-platform::settings` (`settings.toml`) never writes or reads a `chat` section: `SettingsFile` has no field for it, `from_settings` drops it and `into_settings` starts from the defaults. So every local chat setting (all the Advanced chat controls of Text chat 19, convert emoticons, scroll to bottom on send and so on), every draft and the recent searches are lost when the app restarts. Steps to reproduce: 1. Run the app, change a local chat setting (for example `SetChatSetting(ShowSendButton(true))`) or type a draft. 2. Quit and start the app again. 3. The setting is back to its default and the draft is gone; `settings.toml` has no `[chat]` table. The core tests (`old_settings_files_load`, `local_chat_settings_defaults_and_persist`) only check the `SaveSettings` effect, so they pass. To do: add a `[chat]` table to `SettingsFile` (all fields `serde(default)`, so files written before text chat still load), map it in `from_settings` / `into_settings`, and add a round-trip test in `fluxer-platform`. Related: #315 (recent searches).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#371
No description provided.