Repository navigation
[CHA-5933] feat: add scheduled messages support - #221
Conversation
Add Channel#schedule_message (SendMessage with scheduled_at) and Client#update_scheduled_message, #delete_scheduled_message, #send_scheduled_message_now and #query_scheduled_messages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
CI note: the 🤖 Generated with Claude Code |
shaljam
left a comment
There was a problem hiding this comment.
LGTM. I checked all five methods against the chat backend (routes, payload fields, server-side owner lookup, query filter/sort/cursor) along with the claims in the docs page, and they all match. There's one optional note inline about the live-spec skip.
A response without scheduled_message means the backend posted the message immediately; that is the failure mode the spec should catch. Keep the skip only for the "scheduled messages are not enabled" error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
standard-version skipped both: their subjects start with a [CHA-...] prefix, so they don't parse as conventional commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TLDR
Adds server-side support for Chat scheduled messages: schedule a message for a user, then edit it, cancel it, send it right away, or list a user's scheduled messages. Backend endpoints are behind a per-app flag and not yet released; merge after backend CHA-5924 ships. Risk is low: the change only adds new methods, and existing calls are untouched.
Linear: https://linear.app/stream/issue/CHA-5933
CLA
Description of the pull request
New methods, mirroring the reminders / drafts layout:
Channel#schedule_message(message, user_id, scheduled_at, **options)POST /channels/{type}/{id}/messagewithscheduled_at; the response carriesscheduled_messageClient#update_scheduled_message(id, message:, scheduled_at:)PATCH /scheduled_messages/{id}Client#delete_scheduled_message(id)DELETE /scheduled_messages/{id}Client#send_scheduled_message_now(id)POST /scheduled_messages/{id}/send_nowClient#query_scheduled_messages(user_id, filter:, sort:, **options)POST /scheduled_messages/query(filter.cid,filter.status,limit,next)scheduled_atacceptsDateTime,Timeor an RFC 3339 string, normalized likeremind_at. Docs: newdocs/messages/scheduled_messages.md, plus thescheduled_message.sent/scheduled_message.failedwebhook events indocs/webhooks/webhook_events.md. CHANGELOG is left to the release tooling.Not added:
include_scheduled_messageson GetOrCreateChannel (the backend ignores it for server-side calls), app settings (thechat_scheduled_messages_*flags aren't exposed through the app settings API), and a permission constant (the SDK has no list of v2 permission actions).Tests
spec/scheduled_messages_spec.rb: checks the request shape against a stubbed Faraday adapter. It needs no credentials and always runs.spec/client_spec.rb→scheduled messages: live round trip (schedule, query, update, send now, delete). It skips when the app has the feature off (scheduled messages are not enabled) or the backend ignoresscheduled_at, so CI stays green until the flag is on for the CI app.feature/cha-5924-scheduled-messages-channel-state, using an app with the flag on. They skip as expected against an app with the flag off. Rubocop andsrb tcare clean (no new Sorbet errors).🤖 Generated with Claude Code