Repository navigation
feat!: [CHA-5933] add scheduled messages - #78
Open
nijeesh-stream wants to merge 2 commits into
Open
nijeesh-stream wants to merge 2 commits into
nijeesh-stream wants to merge 2 commits into
Conversation
Regenerate from chat master 39c07c8b1ce1a145a754e883721796c66467f313, add the MultipartRequest marker interface the generator now emits, and cover the scheduled message endpoints with an integration test. BREAKING CHANGE: getActivity gained $skipOwnFollowings before $userID, so positional callers bind to different parameters; AIVideoConfig::$provider is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Adds Chat scheduled messages to the PHP SDK.
SendMessageRequesttakesscheduledAt, and the response then carriesscheduledMessageinstead of posting to the channel.ChatClientgets four methods to manage pending messages:queryScheduledMessages,updateScheduledMessage,sendScheduledMessageNowanddeleteScheduledMessage.This is a plain regeneration from the backend spec, plus one integration test and a one-file marker interface the generator now requires. The SDK was behind chat
master, so the regeneration also brings in other API changes (listed below). Two of them break callers, so the title has!.Risk: merge only after backend CHA-5924 is deployed. Older backends ignore
scheduled_atand send the message immediately.Ticket
Summary
Generated from protocol release
openapi-v239.72.0(chatv239.72.0). Merge after backend CHA-5924 is deployed, because older backends ignorescheduled_atand send immediately.The first version of this PR was generated from a local spec at chat master
39c07c8b. Regenerating from the release changed only two doc comments,ScheduledMessageResponseandScheduledMessagesFilterstatus, from GetStream/chat#18730.How it was built:
generate.shran unchanged, with../chatchecked out at tagv239.72.0. Itsmake openapioutput is byte-identical to the protocol release spec. The script runs the generator,generate-webhook-fixtures(no fixture changes), theCallParticipantsed fix, PHP CS Fixer, PHPStan (no errors) andcomposer dump-autoload. PHP 8.5 and Composer 2 ran from thecomposer:2image.Open PR #77 (regen from
v239.67.0) covers a subset of these unrelated changes. This PR supersedes it.Scheduled messages (backend CHA-5924: GetStream/chat#18596, #18597, #18655, #18656)
SendMessageRequest::$scheduledAtandSendMessageResponse::$scheduledMessageChatClient::queryScheduledMessages()(POST /api/v2/chat/scheduled_messages/query); server-side calls needuserIDChatClient::updateScheduledMessage($id, …)(PATCH /api/v2/chat/scheduled_messages/{id})ChatClient::sendScheduledMessageNow($id, …)(POST …/{id}/send_now)ChatClient::deleteScheduledMessage($id)(DELETE …/{id})ChannelStateResponse::$scheduledMessagesScheduledMessage*modelsscheduled_message.sent/scheduled_message.failedwebhook events inWebhookScheduled messages are off by default per app; Stream turns them on. The new
tests/Integration/ChatScheduledMessagesIntegrationTest.phpschedules a message, then queries, updates, sends it now, and deletes one. It skips on error 114 (feature disabled) and when the backend ignoresscheduled_at. I ran it locally against a chatmasterserver with the feature on, and both tests passed (20 assertions). Integration tests run in the daily job, not on PRs.MultipartRequestmarker (hand-written,src/GeneratedModels/MultipartRequest.php)Since GetStream/chat#17967 (CHA-5084), the generator marks the four upload request models
implements MultipartRequest. The interface itself was meant to ship in a separate SDK PR, which hasn't landed yet. Without it, PHPStan fails and those four classes fatal on load. This PR adds the empty interface only.Client::makeRequeststill picks multipart from its own list, so upload behaviour is unchanged. Switching the transport to the marker is left to the CHA-5084 SDK PR.Unrelated changes picked up since the last release
Breaking:
FeedsTrait::getActivity()gained?bool $skipOwnFollowingsbefore$userID, so positional callers now bind to the wrong parameters.AIVideoConfig::$provideris removed.ActivityResponse,CreatePollRequest,EventHook,SubmitActionRequest). Named-argument callers are unaffected; positional ones are not.Additive:
queryChannelBansand theChannelBan*models;cooldownRemainingMs;AppResponseFields::$defaults; poll i18n fields andconfigKey/configTeamon poll writes;expiresAton reminders;getPollOption(…, ?string $userID).checkGCPPubSuband GCP Pub/Sub fields onEventHook.commentFeedback, user interests upsert/delete,skipExisting, async batch follow/unfollow,includeGroupCounts, ranking config,hiddenon comments, top-level comment counts,deleteCollections(…, ?bool $hardDelete).queryCallRingAttemptsandCallRingSettledEvent.countryCode,delete_poll*review actions,ReviewQueueItemResponse::$poll.Checklist
make lint(PHPStan clean) andmake test-unit(322 tests) pass locally on PHP 8.1🤖 Generated with Claude Code