Skip to content

feat: [CHA-5933] add scheduled messages - #374

Open
nijeesh-stream wants to merge 2 commits into
mainfrom
feat/cha-5933-scheduled-messages
Open

nijeesh-stream wants to merge 2 commits into
mainfrom
feat/cha-5933-scheduled-messages

Conversation

@nijeesh-stream

@nijeesh-stream nijeesh-stream commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Adds Chat scheduled messages to the SDK: sendMessage takes scheduled_at (the response then carries scheduled_message instead of posting to the channel), and four new chat methods manage pending ones: queryScheduledMessages, updateScheduledMessage, sendScheduledMessageNow, deleteScheduledMessage. It is a plain regeneration from the backend spec plus one integration test. Because this SDK was behind chat master, the regeneration also picks up other API changes (listed below), including a few removed moderation "intent" fields that are breaking for anyone who used them.

Risk: merge only after backend CHA-5924 is deployed. Older backends ignore scheduled_at and send the message immediately.

Ticket

Summary

Generated from protocol release openapi-v239.72.0 (chat v239.72.0). Merge after backend CHA-5924 is deployed, because older backends ignore scheduled_at and send immediately.

The first version of this PR was generated from a local spec at chat master 39c07c8b. I regenerated it from the release: the spec built at chat v239.72.0 is byte-identical to the protocol release yaml. The regeneration changed only two doc comments, ScheduledMessageResponse.status and ScheduledMessagesFilter.status, from GetStream/chat#18730.

generate-openapi.sh ran unchanged, with ../chat checked out at tag v239.72.0. Its make openapi output is identical to the protocol release spec. Then yarn lint:gen.

Scheduled messages (CHA-5924 backend: GetStream/chat#18596, #18597, #18655, #18656)

  • SendMessageRequest.scheduled_at / SendMessageResponse.scheduled_message
  • ChatApi.queryScheduledMessages (POST /api/v2/chat/scheduled_messages/query). Server-side calls need user_id.
  • ChatApi.updateScheduledMessage (PATCH /api/v2/chat/scheduled_messages/{id})
  • ChatApi.sendScheduledMessageNow (POST /api/v2/chat/scheduled_messages/{id}/send_now)
  • ChatApi.deleteScheduledMessage (DELETE /api/v2/chat/scheduled_messages/{id})
  • ChannelStateResponse.scheduled_messages, plus the ScheduledMessage* models and the scheduled_message.sent / scheduled_message.failed webhook events

The feature is off by default per app; Stream enables it. The new test (__tests__/scheduled-messages.test.ts) schedules a message and then queries, updates, sends now and deletes. It skips itself when the test app returns error 114 (feature disabled) or when the backend ignores scheduled_at. So until the test app has the feature, CI shows these tests as skipped. I ran it locally against a chat master server with the feature on, and all 4 tests passed.

Unrelated changes picked up since the last release

Breaking (removed):

  • IntentDetectedEvent and IntentBufferedItem are removed, along with the moderation.intent_detected member of the WHEvent union.
  • CheckResponse: intent_matched_topic, intent_score, intent_score_threshold and intent_would_fire are removed, and intent_scores: IntentScoreResponse[] replaces them.
  • IntentTopicRequest / IntentTopicResponse: analysis_cooldown_seconds, enabled, max_captured_items, refire_cooldown_seconds and score_threshold are removed. Intent now lives in rule-builder conditions (RuleBuilderCondition.intent_rule_params).

Tightened types (now required): ChannelMemberResponse.user_id, OwnUserResponse.blocked_user_ids.

Additive:

  • Chat: ChannelApi.queryChannelBans, plus QueryChannelBans* and the ChannelBan* models
  • Chat: cooldown_remaining_ms on APIError and ChannelStateResponse
  • Chat: GroupedQueryChannelsRequest.sort and filter_conditions on grouped-channel groups
  • Chat: AppResponseFields.defaults
  • Chat: poll events (PollClosedEvent, PollUpdatedEvent, PollVote*Event, …)
  • Chat: config_key/config_team on the poll write requests
  • Feeds: hard_delete on deleteCollections
  • Video: CallSettings*.lifecycle and ClientEvent.leave_reason/leave_initiator
  • Feeds: skip_existing on add/upsert activities, async + task_id on batch follow/unfollow, include_group_counts on queryFollows, ranking_config/include_ranking_config, parent_id on notification comments, and the feeds push template event types
  • Moderation: llm_model/llm_reasoning_effort on check/analyze, the delete_poll* review actions, ReviewQueueItemResponse.poll and UserChannelBanCountRuleParameters

Checklist

  • yarn lint and tsc (src) pass
  • New integration test, run locally against chat master
  • CI green (scheduled-message tests skip on the CI test app, as expected)

🤖 Generated with Claude Code

Regenerate from chat master 39c07c8b1ce1a145a754e883721796c66467f313 and
cover the scheduled message endpoints with an integration test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants