devserver: scripted relationship events are not kept, so ignoring or accepting a scripted friend request is refused #948

Open
opened 2026-11-19 11:05:26 +00:00 by charles · 0 comments
Owner

Found while writing the desktop shell acceptance test (Shell 44, #836) on origin/shell at 46c0bdfe3.

What: a relationship the devserver plays from a scenario's [[event]] list (for example RELATIONSHIP_ADD with fixture = "shell_friend_request.json" in fixtures/scenarios/shell.toml) reaches the client but is not entered in the devserver's own relationship state. DELETE /users/@me/relationships/{id} (remove_relationship, crates/fluxer-devserver/src/social.rs) then answers "unknown user", so ignoring or accepting hedy's scripted friend request from the client fails.

Steps: cargo run -p fluxer --features devserver -- --devserver shell; wait 3.5 s for hedy's request; Friends -> Pending -> Ignore (or Accept). Expected: the request goes (RELATIONSHIP_REMOVE / RELATIONSHIP_ADD type 1). Actual: the REST call is refused and the request stays.

Expected fix: scripted RELATIONSHIP_ADD / RELATIONSHIP_REMOVE events update the devserver's relationship store (store_relationship / drop_relationship) as they are dispatched, so the REST endpoints see them.

The acceptance test works around it by sending the server's RELATIONSHIP_REMOVE itself (hedy withdraws her request).

Found while writing the desktop shell acceptance test (Shell 44, #836) on `origin/shell` at 46c0bdfe3. **What:** a relationship the devserver plays from a scenario's `[[event]]` list (for example `RELATIONSHIP_ADD` with `fixture = "shell_friend_request.json"` in `fixtures/scenarios/shell.toml`) reaches the client but is not entered in the devserver's own relationship state. `DELETE /users/@me/relationships/{id}` (`remove_relationship`, `crates/fluxer-devserver/src/social.rs`) then answers "unknown user", so ignoring or accepting hedy's scripted friend request from the client fails. **Steps:** `cargo run -p fluxer --features devserver -- --devserver shell`; wait 3.5 s for hedy's request; Friends -> Pending -> Ignore (or Accept). Expected: the request goes (RELATIONSHIP_REMOVE / RELATIONSHIP_ADD type 1). Actual: the REST call is refused and the request stays. **Expected fix:** scripted `RELATIONSHIP_ADD` / `RELATIONSHIP_REMOVE` events update the devserver's relationship store (`store_relationship` / `drop_relationship`) as they are dispatched, so the REST endpoints see them. The acceptance test works around it by sending the server's `RELATIONSHIP_REMOVE` itself (hedy withdraws her request).
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#948
No description provided.