Content: Fix unhandled rejection when scheduled publish fails - #4327
Open
github-actions[bot] wants to merge 4 commits into
Open
github-actions[bot] wants to merge 4 commits into
github-actions[bot] wants to merge 4 commits into
Conversation
Contributor
Author
Code Review — 🔴 1 blocker(s) — see inline comments |
Contributor
Author
Acceptance Criteria QA — ✅ PASSValidates #4326: Error: invalid session
Suggested Cypress coverage
|
Contributor
Author
Code Review — ✅ No blockers |
Contributor
Author
Localization Reviewer — 🔴 2 blocker(s) — see inline comments🔴 Blocking
🟡 AdvisoryNone |
Move onScheduleSuccess/onClose into .then() so they only run when publish() resolves; .finally() now only clears loading state. Also fixes the @ts-expect-error directive, which was suppressing the closing paren line instead of the .then() line it was meant to cover. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Author
Code Review — ✅ No blockers |
Contributor
Author
Localization Reviewer — 🔴 2 blocker(s) — see inline comments🔴 Blocking
🟡 AdvisoryNone |
Contributor
Author
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.


Resolves #4326
Severity: low
Summary
SchedulePublish, even though the user already saw a failure notification.dispatch(publish(...))insrc/shell/components/SchedulePublish/index.tsxonly chained.finally(), andpublish()insrc/shell/store/content.jsre-throws after notifying (line 908), so the rejection had nowhere to land. Added a.catch(() => {})after the.finally()to swallow the already-handled error.Classification
lastAction/notification text ("Error scheduling... version 20") matches exactly the notify+rethrow inpublish()'s catch block (src/shell/store/content.js:898-909), and the only caller using.finally()without a.catch()isSchedulePublish/index.tsx:91-109. One clear fix, no design judgment involved.src/shell/components/SchedulePublish/index.tsx— not auth.js, not permissions, not IndexedDB warm-cache hydration, not RTK Query base config, not webpack, not workflows..catch()after an existing.finally()doesn't change any notification or control flow the user sees; it only prevents the already-handled rejection from surfacing as unhandled.Test plan
onScheduleSuccess, loading state, and dialog close behavior are unchanged.