Repository navigation
feat(ScheduledMessages): handle failed scheduled messages (REACT-1390) - #3372
Draft
NikolaGoranNaumovski wants to merge 6 commits into
Draft
NikolaGoranNaumovski wants to merge 6 commits into
NikolaGoranNaumovski wants to merge 6 commits into
Conversation
A failed scheduled message cannot be edited, so Edit in its row menu now
opens it with MessageComposer.rescheduleFailedMessage: the composer is
filled as a new composition, shows a FailedScheduledMessagePreview
("Schedule again", overridable through ComponentContext) and can schedule
it from the schedule button. Scheduling deletes the failed message; cancel
restores the earlier draft. Sending it right away also deletes the failed
message.
openScheduledMessageInComposer picks edit or schedule-again by status for
the banner list and the Channel Detail section.
Refs: REACT-1390
Chat listens for scheduled_message.failed (sent only to the scheduling user while connected) and adds an error notification of type api:scheduled-message:send:failed with the failure reason. The new translateScheduledMessageSendFailed shows "Scheduled message not sent" with the reason copy used in the list; user_deleted adds no reason. Refs: REACT-1390
The banner adds "N failed" after its count when scheduled messages in the channel or thread failed (useFailedScheduledMessageCount), with a --failed modifier for styling. Tests also cover the banner disappearing when the store is reset for another user. Refs: REACT-1390
…idable Add ComponentContext slots used by the default components: - ScheduledMessageList, for the banner's list dialog and the Channel Detail section - ScheduledMessageActions, the actions button on each list item (null hides it) - DeleteScheduledMessageAlert and RescheduleMessageDialog, opened from the row menu Refs: REACT-1390
Translate the banner's failed count (with each locale's plural forms), the schedule-again preview and the failed-send notification in all 12 locales. Refs: REACT-1390
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…act-1390-scheduled-messages-failures # Conflicts: # src/i18n/TranslationBuilder/notifications/translators.ts # src/i18n/__tests__/scheduledMessageNotificationTranslators.test.ts
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.
🎯 Goal
Handle scheduled messages that fail to send, so a failure is never silent and the user can recover:
It also finishes the customisation story for the scheduled message UI with the remaining
ComponentContextslots. This follows the web designs (Figma: Scheduled List → Row Menu (Failed), Failed Reasons; Confirmation → Failed).Part of the scheduled messages feature (REACT-1390). Stacked on #3371 (manage actions). Depends on GetStream/stream-chat-js#1956 for
MessageComposer.rescheduleFailedMessage.🛠 Implementation details
Schedule a failed message again
message.idreturns the failed row. So Edit on a failed item opens it withcomposer.rescheduleFailedMessage(failedMessage). The composer is filled as a new composition with a fresh id, without edit mode.FailedScheduledMessagePreview("Schedule again"), with a cancel button that restores the earlier draft. The schedule button stays available.MessageComposer). Sending it right away with Enter or Send also deletes the failed message.openScheduledMessageInComposer(composer, scheduledMessage)picks edit or schedule-again by status. Both the banner's list and the Channel Detail section use it.channel_deleted): Copy, Delete (unchanged);Failure notification
Chatlistens forscheduled_message.failed(sent only to the scheduling user while connected) and adds an error notification of typeapi:scheduled-message:send:failed, with the failure reason.translateScheduledMessageSendFailedshows "Scheduled message not sent: ", using the same reason copy as the list.user_deletedadds no reason.Chatunmounts.Failed count in the banner
useFailedScheduledMessageCount), with astr-chat__scheduled-messages-banner--failedmodifier.disconnectUser), the banner disappears.Override slots (
ComponentContext)ScheduledMessageListScheduledMessageListScheduledMessageActions(nullhides it)ScheduledMessageActionsDeleteScheduledMessageAlertDeleteScheduledMessageAlertRescheduleMessageDialogRescheduleMessageDialogFailedScheduledMessagePreviewFailedScheduledMessagePreviewTranslations
All new strings are in the 12 locales, including each locale's plural forms for "N failed".
Commits
Each commit typechecks and passes the scheduled-message, composer, Chat, Channel Detail and i18n tests on its own. The full suite passes on the last commit (3479 tests).
Testing
openScheduledMessageInComposerfor pending and failed messages.channel_frozenafter its channel was frozen. It was then scheduled again withrescheduleFailedMessage. The server kept only the new message, the failed one left the store, and the earlier draft came back.Not in this PR
🎨 UI Changes
Screenshots: banner with "1 failed", row menu for a failed message, "Schedule again" preview in the composer, failed-send notification.