Synced preferences: match each PatchUserSettings answer to its request (Text chat 14 and 19) #373

Open
opened 2026-11-13 00:01:45 +00:00 by charles · 0 comments
Owner

Found in the review of Text chat 14 (PR #312, issue #264).

crates/fluxer-core/src/chat/expressions.rs, on_result: on ApiResult::UserSettingsPatched the expressions prefs writer drops the oldest entry of prefs.in_flight without checking which request the answer belongs to (the answer carries no request id). That is correct only while expressions is the only sender of ApiRequest::PatchUserSettings. Once Text chat 19 (#269) also sends that request, its answer can remove a prefs write that is still unanswered; if that write then fails, its pending change is lost.

To do: attribute answers by effect id (or have the answer carry the request id) so each reducer only clears its own in-flight write, and cover interleaved 14/19 writes with a test (the failed write must keep its change). Related: #370 (one writer of the snapshot), #348 (base hash and conflict handling).

Seen on commit 2fa552b (branch textchat-14-core-expressions).

Found in the review of Text chat 14 (PR #312, issue #264). `crates/fluxer-core/src/chat/expressions.rs`, `on_result`: on `ApiResult::UserSettingsPatched` the expressions prefs writer drops the oldest entry of `prefs.in_flight` without checking which request the answer belongs to (the answer carries no request id). That is correct only while expressions is the only sender of `ApiRequest::PatchUserSettings`. Once Text chat 19 (#269) also sends that request, its answer can remove a prefs write that is still unanswered; if that write then fails, its pending change is lost. To do: attribute answers by effect id (or have the answer carry the request id) so each reducer only clears its own in-flight write, and cover interleaved 14/19 writes with a test (the failed write must keep its change). Related: #370 (one writer of the snapshot), #348 (base hash and conflict handling). Seen on commit 2fa552b (branch textchat-14-core-expressions).
charles added this to the Text chat milestone 2026-11-13 00:01:45 +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#373
No description provided.