Text chat 37: fluxer-api channel-type endpoints (#322) #429
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "textchat-37-api-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?
What
Task 37 of the Text chat plan: the
fluxer-apichannel-type endpoints of spec §18.3, built against Task 36's proto types.forums.rs(new):create_forum_post(JSON, also the presigned path withupload_filenameinmessage.attachments),create_forum_post_with_files(multipartpayload_json+files[n],message.attachments[i].id = i, not observed),search_threads(HTTP 202 ->ThreadSearchResponse::NotReady),post_data(chunks of 100, merged; no request for an empty list).announcements.rs(new):crosspost,crosspost_source,follow_channel.threads.rs:archived_public_threads,archived_private_threads(timestampbefore),my_archived_private_threads(channel, before: Option<Snowflake>, limit)(snowflakebefore, limit clamped 2-100),edit_thread,add_thread_member,remove_thread_member,patch_thread_member_settings.dms.rs:get_channel,delete_channel.messages.rs:purge_personal_notes.uploads.rs: the multipart builder moved into a sharedpost_multipart+attachments_for;send_message_with_filesbehaves exactly as before (its tests unchanged and passing).Routes checked against the fork:
ThreadController.ts,ForumController.ts,ThreadMemberSettingsController.ts,ChannelFollowController.ts,MessageController.ts:414-560,ChannelController.ts:209; the multipart forum body againstThreadController.ts:113-131andfeat/forum/commands/ForumCommands.ts:58-91.Tests
crates/fluxer-api/tests/channel_types.rs(wiremock, Task 36 fixtures): every test the plan names, pluscreate_forum_post_presigned_sends_upload_filename_in_json,delete_channel_pathandthread_member_settings_200_with_member_is_ok. Seen failing (no methods) before the implementation, passing after.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally.Deviations / choices
add_thread_member,remove_thread_memberandpatch_thread_member_settingsreturnResult<()>(settings answers 200 with the member or 204; the change also arrives asTHREAD_MEMBER_UPDATE).delete_channelsends the sameDELETE /channels/{id}as the existingclose_channel(no sudo body; the server only needs one withdelete_messageson a group DM).Stacked on: textchat-36-proto-channel-types
Closes #322
🤖 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>Independent review: Text chat 37 (api-channel-types), commit
8bf7e40Reviewed only
git diff 6bca3ed..origin/textchat-37-api-channel-types.1. Plan tests: all 12 named tests exist in
crates/fluxer-api/tests/channel_types.rsand assert what the plan says. That covers:payload_json, thenfiles[0],files[1], withattachments[i].id = "i")NotReady { retry_after_s: 2.0 }beforeon the archived lists, and the snowflakebeforeon the user's own list (limit clamped 250 -> 100)channel_threadsinX-Fluxer-Featureson 8 routesThere are 3 extra tests: the presigned
upload_filename, the delete path, and a settings call answered 200 with a body.2. Interfaces: every signature in the Interfaces block exists as written. The open choices are reasonable: the thread-member calls return
Result<()>, anddelete_channeldelegates toclose_channel.3. Invariants: only
fluxer-apichanged, with no new dependencies and no changes to core, UI or fixtures. The only panics are in tests. The upload still goes throughunobserved(). No secrets or URLs are added: theupload_filenamein a test is a mock key. I checked the routes and verbs against the fork's controllers (ThreadController, ForumController, ChannelFollowController, MessageController:415/499/529, ThreadMemberSettingsController) and they match.4. Review Focus #4 (uploads):
post_multipart/attachments_foris a behaviour-preserving extraction.send_message_with_filesbuilds the same form, with the same timeout,Retry::Neverand progress counter. The forum post reuses the same builder.5. Local gate:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin a fresh review worktree: all steps passed (exit 0). channel_types: 15 passed.Findings: none (no blocking, no minor).
Verdict: APPROVED