Skip to content

fix(modal): Reset boundary errors without remounting children - #129736

Merged
TkDodo merged 1 commit into
masterfrom
tkdodo/fix/modal-boundary-reset-key
Nov 3, 2026
Merged

TkDodo merged 1 commit into
masterfrom
tkdodo/fix/modal-boundary-reset-key

Conversation

@TkDodo

@TkDodo TkDodo commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Repeated calls to open an already visible sudo modal can cause an endless loop of organization requests that return 403. The modal's changing React key remounts its query subscriptions, and each new error opens the modal again.

Replace the React key with an ErrorBoundary resetKey prop. A changed token clears the stored error while preserving healthy modal children. This keeps the error recovery from #129199 without restarting the authentication flow on every open call.

The existing same-renderer recovery test passes unchanged. A new test confirms that repeated open calls preserve typed input; it failed before this fix. Both relevant suites pass all 27 tests.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 3, 2026
@TkDodo

TkDodo commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

bugbot run

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-qf4bluj1j.sentry.dev

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 45e5391. Configure here.

@TkDodo
TkDodo marked this pull request as ready for review November 3, 2026 19:26
@TkDodo
TkDodo requested a review from a team as a code owner November 3, 2026 19:26
resetKey: this.props.resetKey,
};

static getDerivedStateFromProps(props: Props, state: State): Partial<State> | null {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that's a name I've not heard in a long time. A long time.

@TkDodo
TkDodo merged commit 8940247 into master Nov 3, 2026
85 checks passed
@TkDodo
TkDodo deleted the tkdodo/fix/modal-boundary-reset-key branch November 3, 2026 19:32

This branch was successfully deployed

1 active deployment
Preview — 45e53919 Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants