Text chat 36: fluxer-proto channel types: forums, media, links, announcements, thread admin (#321) #351
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "textchat-36-proto-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?
Implements spec section 18.3 in
fluxer-proto(plan Task 36).url,flags,applied_tags,member_ids_preview,available_tags,default_reaction_emoji,default_sort_order,default_forum_layout,default_tag_setting,default_auto_archive_duration,default_thread_rate_limit_per_user(lenient,serde(default), skipped when empty so old fixtures round-trip byte for byte);newly_createdread from THREAD_CREATE, never serialised.ChannelFlags,ForumTag,DefaultReaction,ForumSortOrder,ForumLayout(unknown kept),ForumTagSetting(unknown -> MatchSome).models::forum: forum post create/created, thread search query/response (202 ->NotReady), post data, limits;models::thread: archived threads, edit thread (only set fields), member settings patch, follow/crosspost, purge result.GuildSubscription.{threads, thread_member_lists}(old frames identical), op 28RequestForumUnreads,FORUM_UNREADSandTHREAD_MEMBER_LIST_UPDATEdispatches.b047b68).tests/channel_types.rs(24 tests + proptestarbitrary_parent_fields_never_panic), spec contract againstspec/openapi.json.Local gate:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen onf5cd92e(merged with origin/textchat).Closes #321
🤖 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>Review round 1, changes per finding:
models/forum.rs,gateway/forum.rs,tests/channel_types.rs) is now committed as4601091feat(proto): forum, media, link, announcement and thread admin typeson top of the fixture commitb047b68, merged with origin/textchat (f5cd92e), pushed totextchat-36-proto-channel-types, and opened as this PR. Diff to review:9fcc13d..origin/textchat-36-proto-channel-types.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cionf5cd92ewith no other cargo build running; it completed withall steps passed(channel_types: 24 tests plus the proptest, all ok; livekit-interop skipped as usual).Merged origin/textchat (
7a0678e) into the branch. Task 18 (core threads) builds aChannelliteral influxer-core/src/chat/threads.rs::channel_of, so the merge needed the new Task 36 fields filled in (c66a96e,flagstaken from the thread, the rest empty/None). This is the only change outside fluxer-proto.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cionc66a96e: all steps passed.Independent review: Text chat 36 (proto channel types)
Reviewed
67da1c7..400a708(b047b68fixtures,4601091feat,c66a96ecore fix, merges).Checks
crates/fluxer-proto/tests/channel_types.rs, plusspec_contract_channel_type_requestsintests/spec_contract.rs(againstspec/openapi.json). They assert the spec's values: flags bits 1<<1/1<<4/1<<15, layout 0/1/2, sort 0/1,match_somedefault, limits 20/5/50/4096/25/9975/100/40/25, op 28, 202retry_after, repeatedtag, ISObefore.newly_createdread but never written),ChannelFlags,ForumTag::emoji,DefaultReaction::as_reaction_emoji, the enums withUnknownkept, every request/answer type,GuildSubscription.{threads, thread_member_lists},RequestForumUnreads::into_envelope, the twoGatewayEventvariants,TYPED_DISPATCH_NAMES+= 2, and theforum::limit constants.Opcode::RequestForumUnreads = 28was already on the base.ThreadParentSettings.ts:180-222(forum always has flags/tags/tag_setting, media has no layout, text parents get only the set defaults),guild_request_forum_unreads.erl(count capped at 25 ormissing),guild_thread_subscriptions.erl:562-578,ThreadDispatch.ts:26-39,ForumRequestSchemas.ts,CrosspostSourceSchemas.ts,MessageController.tspurge, andThreadConstants.ts. Commitb047b68names each source file. The proptest shows malformed parent fields never cost the channel. No secrets, signed URLs or paths.FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin the review worktree on400a708: green (exit 0).Findings
c66a96echangescrates/fluxer-core/src/chat/threads.rs(channel_of), which is outside the Files list. It is the minimal change that lets core compile against the newChannelfields (it fills defaults and copiesflags) and adds no dependency. Acceptable; noted for scope.CrosspostSourceGuild.{icon, banner, description, features}are not read leniently. A wrong-typed value from the server fails the whole crosspost-source answer (an error, not a panic). Considerlenient_optionwhen Task 37/48 consume it.Verdict: approve. No blocking findings, and local CI is green.