Runtime: run ApiRequest::EditGroupDmIcon (group DM icon) in the Text chat runtime #372

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

Found in the review of PR #350 (Text chat 19, #269), round 1.

fluxer-core on textchat-19-core-dms-settings adds ApiRequest::EditGroupDmIcon { channel_id, name, icon: FileRef } (crates/fluxer-core/src/effect.rs): EditGroupDm with a new icon asks for it, and the runtime is meant to read the file and send PATCH /channels/{id} with the name and the icon as a data URI.

The Text chat 21 runtime (PR #368, #271, apps/fluxer/src/runtime.rs on textchat-21-app-textchat-runtime) ends its chat request match with _ => return Err(not_a_chat_request()), which answers 501 CLIENT_NOT_WIRED. Once both are merged, setting a group DM icon fails.

Steps to reproduce (after both merge): open a group DM, pick a new icon in the edit dialog, save. Expected: the icon changes. Actual: the request is answered with CLIENT_NOT_WIRED.

Fix: in the runtime, handle ApiRequest::EditGroupDmIcon by reading the FileRef (as the attachment upload path does), building data:<mime>;base64,... and sending EditChannel with name and icon; answer as for EditChannel. Add a runtime test with a fake API.

Seen on commit 1630a19 (textchat-19) and the current head of textchat-21-app-textchat-runtime.

Found in the review of PR #350 (Text chat 19, #269), round 1. `fluxer-core` on `textchat-19-core-dms-settings` adds `ApiRequest::EditGroupDmIcon { channel_id, name, icon: FileRef }` (crates/fluxer-core/src/effect.rs): `EditGroupDm` with a new icon asks for it, and the runtime is meant to read the file and send `PATCH /channels/{id}` with the name and the icon as a data URI. The Text chat 21 runtime (PR #368, #271, `apps/fluxer/src/runtime.rs` on `textchat-21-app-textchat-runtime`) ends its chat request match with `_ => return Err(not_a_chat_request())`, which answers 501 CLIENT_NOT_WIRED. Once both are merged, setting a group DM icon fails. Steps to reproduce (after both merge): open a group DM, pick a new icon in the edit dialog, save. Expected: the icon changes. Actual: the request is answered with CLIENT_NOT_WIRED. Fix: in the runtime, handle `ApiRequest::EditGroupDmIcon` by reading the `FileRef` (as the attachment upload path does), building `data:<mime>;base64,...` and sending `EditChannel` with `name` and `icon`; answer as for `EditChannel`. Add a runtime test with a fake API. Seen on commit 1630a19 (textchat-19) and the current head of textchat-21-app-textchat-runtime.
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#372
No description provided.