Guild settings: an answer to the first of two in-flight writes briefly hides the second write's optimistic change #559

Open
opened 2026-11-14 16:09:26 +00:00 by charles · 0 comments
Owner

Follow-up from the review of PR #557 (Task 12, #497).

NotifSettings takes each GuildSettingsPatched answer as the scope's whole entry and re-applies only changes not yet sent. With two writes in flight for the same scope, the answer to the first one replaces the entry, so the second write's optimistic change disappears until that write's own answer arrives. It is transient: the proptest writes_and_events_converge_to_server_state shows the store still converges to the server state.

Possible fix: keep the patches of in-flight writes (not only unsent changes) and re-apply those after the oldest one is retired, mirroring how the original keeps pending state.

Seen on branch dailyuse-12-core-notification-settings-mutes (commit b9a14eb).

Follow-up from the review of PR #557 (Task 12, #497). `NotifSettings` takes each `GuildSettingsPatched` answer as the scope's whole entry and re-applies only changes not yet sent. With two writes in flight for the same scope, the answer to the first one replaces the entry, so the second write's optimistic change disappears until that write's own answer arrives. It is transient: the proptest `writes_and_events_converge_to_server_state` shows the store still converges to the server state. Possible fix: keep the patches of in-flight writes (not only unsent changes) and re-apply those after the oldest one is retired, mirroring how the original keeps pending state. Seen on branch dailyuse-12-core-notification-settings-mutes (commit b9a14eb).
charles added this to the Daily use milestone 2026-11-14 16:09:30 +00:00
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#559
No description provided.