Text chat 41: fluxer-devserver channel types (#326) #430
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "textchat-41-devserver-channel-types"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on: textchat-36-proto-channel-types
What this builds (Task 41, spec §18.6)
The
textchatdevserver scenario gains every channel type and the endpoints and gateway frames around them:fixtures/textchat/{forum_posts,media_posts,channel_types}.json, appended totextchat_ready.json): forum#ideas(guidelines intopic, REQUIRE_TAG, 4 tags with "Announcement" moderated, 👍 default reaction) with 30 posts: 1 pinned, 3 followed (READY acks their 3rd message, so 3 unread each), 19 other active, 7 archived; starters with and without pictures. Media#gallery(HIDE_MEDIA_DOWNLOAD_OPTIONS, 8 picture/clip posts). Announcement#releases(one published, one unpublished message of the user's) and its thread "1.4 feedback". Link channel "Docs" (urlon an untrusted host). Voice channel "Hangout" with 3 messages. Private thread "Moderators only". Personal notes (type 999, id = the user's) with 4 messages. A generator script made the post files; every thread/message is shaped like the server's (sources cited in the fixtures commit).threads: true→THREAD_LIST_SYNCof every active thread of a thread-enabled guild (the gateway's store holds active threads only) plus the user's memberships; op 14thread_member_lists→THREAD_MEMBER_LIST_UPDATEper thread (≤10); op 28 →FORUM_UNREADS(missingwithout an ack, else the count after it, capped at 25; posts of other channels left out), asguild_request_forum_unreads.erl.forums.rs, thread search insearch.rs):GET /channels/{id}; forum/media posts viaPOST /channels/{forum}/threads(JSON and multipart;ForumTagRules.tsvalidation: UNKNOWN_FORUM_TAG, moderated tags, FORUM_TAG_REQUIRED, ≤5 tags, title length, empty starter; starter id = post id;THREAD_CREATEwithnewly_createdthenMESSAGE_CREATE; a refused starter discards the post); thread search (202SEARCH_INDEX_NOT_READYon the first call per channel, then name/tag/tag_setting/archived/sort/limit/offset withfirst_messagesandmember_ids_preview);post-data; the three archived lists;PATCH /channels/{thread}(+THREAD_UPDATE, one pinned post per forum) andDELETE(+THREAD_DELETE); thread members list/get/add/remove (+THREAD_MEMBERS_UPDATE) and@me/settings(+THREAD_MEMBER_UPDATE); crosspost (+MESSAGE_UPDATEwith CROSSPOSTED, copies to followers) and crosspost-source; followers (+CHANNEL_FOLLOW_ADDnotice "Forked #releases" in the target); notes purge (own notes only,MESSAGE_DELETE_BULK). Messages of forum/media/link/category channels areINVALID_CHANNEL_TYPE.NOT_FOUNDwithoutX-Fluxer-Features: channel_threadsor on a DM (ChannelThreadsRouteGuard); threads, forums and media channels areUNKNOWN_CHANNELto such a client viaGET|PATCH|DELETE /channels/{id}. Scenario flagthread_search = false(newtextchat_no_thread_search.toml) makes search a 404.Testing
crates/fluxer-devserver/tests/channel_types.rs: the 17 tests of the plan, written first and seen failing, all passing.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally (base green before any change, at the merge commit).Deviations / notes for the reviewer
guild_thread_view.erl:125hides them only for non-viewers).fixtures/scenarios/textchat_no_thread_search.toml(needed forthread_search_disabled_flag);tests/textchat.rsnow sends the feature header likefluxer-apiand expects the new READY thread set; Moderators gain MANAGE_WEBHOOKS intextchat_ready.jsonso following works.THREAD_MEMBER_LIST_UPDATEpresences are online for the user and offline for others (the devserver's presences are private tomember_list.rs, which this task does not touch).GET /guilds/{id}/threads/activeis bot-only on the real server; the devserver keeps serving it (now behind the feature header) since existing tests use it.Closes #326
🤖 Generated with Claude Code
REST fixtures, each shaped from the fork's server source (ba98441b4): - channel_forum/media/announcement/link/personal_notes.json: fluxer_api/src/api/channel/ChannelMappers.ts:96-172 (serializeThreadOnlyChannel, serializeGuildTextChannel, serializeGuildLinkChannel, serializeDMPersonalNotesChannel) plus services/thread/ThreadParentSettings.ts:180-222 (mapThreadParentFields: forum and media always carry flags, available_tags, default_tag_setting; media lacks default_forum_layout; text parents only the set default_*) - thread_private/thread_announcement.json, forum_post_created.json: services/thread/ThreadMappers.ts:58-92 (invitable only on private threads; posts carry applied_tags and member_ids_preview) and ThreadCreationService.ts:292 ({...mapThreadToResponse(view), message}), schema ForumRequestSchemas.ts:168-173 - thread_search.json, thread_search_not_ready.json: ForumRequestSchemas.ts:242-276, services/thread/ThreadForumService.ts:110-195 and packages/errors/src/domains/channel/SearchIndexNotReadyError.ts (202, {code, message, documents_indexed, retry_after}; FluxerError.toJSON) - post_data.json: ForumRequestSchemas.ts:181-206, ThreadForumService.ts:60-100 - archived_threads.json: S/channel/ThreadRequestSchemas.ts:109-118 - followed_channel.json: S/channel/ChannelFollowSchemas.ts:12-15 - crosspost_source.json: S/message/CrosspostSourceSchemas.ts - crosspost_message.json: services/message/CrosspostDeliveryService.ts:384-420 and the webhook author of fluxer_messages/src/shard_impl.rs:1456-1470 - purge_notes.json: api/channel/controllers/MessageController.ts:414-427 Gateway fixtures: - forum_unreads.json: fluxer_gateway/src/guild/guild_request_forum_unreads.erl:207-285 - thread_member_list_update.json: guild_thread_subscriptions.erl:535-578 - thread_create_forum_post.json: services/thread/ThreadDispatch.ts:26-39 as forwarded by guild_thread_dispatch.erl:467-471 (public_payload drops member_ids_preview) - lazy_request_threads.json: guild_unified_subscriptions.erl:140-165 Refs #321 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>The textchat scenario serves the channel types of spec §18.6: READY lists only the joined active threads; op 14 `threads: true` answers with a THREAD_LIST_SYNC of the guild and `thread_member_lists` with THREAD_MEMBER_LIST_UPDATE; op 28 answers FORUM_UNREADS. REST: GET /channels/{id}, forum and media posts (JSON and multipart, tag rules, starter id = post id, THREAD_CREATE then MESSAGE_CREATE), thread search (202 on the first call per channel, then filtered, sorted and paged, with first_messages), post-data, the archived lists, PATCH/DELETE of threads, thread members and member settings, crosspost and crosspost-source, followers (CHANNEL_FOLLOW_ADD notice) and the personal notes purge. Thread and forum routes are a 404 without X-Fluxer-Features: channel_threads; `thread_search = false` turns the search off. Refs #326 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Independent review: Text chat 41 (devserver channel types)
Reviewed
dafdbd5..origin/textchat-41-devserver-channel-types(0fae995) cold.Checks
crates/fluxer-devserver/tests/channel_types.rsand assert the spec §18.6 values: 30 posts (1 pinned, 3 joined, 7 archived), 4 tags with 1 moderated, REQUIRE_TAG, HIDE_MEDIA_DOWNLOAD_OPTIONS, 8 media posts, the 202 on the first search then 200, starter id = post id, THREAD_CREATE (newly_created) before MESSAGE_CREATE, CROSSPOSTED, CHANNEL_FOLLOW_ADD, purge only on own notes, the 404s withoutX-Fluxer-Features: channel_threads, andthread_search = false.threads/thread_member_listsand op 28 are served. The devserver is consumed through the existing scenario and proto types (no new public API).fluxer-apialready sendschannel_threads, so the new 404 gating does not break the runtime.fluxer-devserverand fixtures. No core, UI or emoji change. Fixture attachment URLs are plain unsigned/media/attachments/...paths, and there are no tokens or file paths. FORUM_UNREADS shape (missing: truewith no count, cap 25, batch 40) matchesguild_request_forum_unreads.erl. The fixture commit names the server files it was shaped from.cargo xtask ciin the review worktree: green (all steps passed). Also ranFLUXER_SCREENSHOT_TESTS=1 cargo test -p fluxer-ui --test screenshots -- --include-ignoredagainst the changed READY: 51/51 pass.Findings
fixtures/scenarios/textchat.tomlheader says "Old bikeshed" (archived) arrives with op 14'sTHREAD_LIST_SYNC"or the REST lists".thread_list_syncfilters archived threads out, as the test asserts, so in practice it comes only from the REST archived list. The comment wording is misleading.GET /guilds/{id}/threads/activeis bot-only on the real server but is still served here (behind the header) for existing tests. This is a known divergence and should not be relied on by the client.Verdict: APPROVED. No blocking findings; CI green locally.