Skip to content

Fix polymiddleware error should not propagate to React runtime#5833

Merged
compulim merged 4 commits into
microsoft:mainfrom
compulim:fix-polymiddleware-error
May 22, 2026
Merged

Fix polymiddleware error should not propagate to React runtime#5833
compulim merged 4 commits into
microsoft:mainfrom
compulim:fix-polymiddleware-error

Conversation

@compulim
Copy link
Copy Markdown
Contributor

@compulim compulim commented May 22, 2026

Changelog Entry

Fixed

  • Fixed polymiddleware error should not propagate to React runtime if <DebugProvider> is not mounted, by @compulim, in PR #5833

Description

<ErrorBoxPolymiddlewareProxy> and useBuildRenderErrorBoxCallback should have "catchall". Without<DebugProvider>, rendering those component should not throw.

Design

Specific Changes

  • Added a catchall which will null-render if <DebugProvider> or any error box polymiddleware is not added
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim marked this pull request as ready for review May 22, 2026 07:32
@compulim compulim requested a review from a-b-r-o-w-n as a code owner May 22, 2026 07:32
Copilot AI review requested due to automatic review settings May 22, 2026 07:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR prevents error box polymiddleware “fallthrough” warnings/errors from propagating into the React runtime when <DebugProvider> is not mounted, by adding a null-rendering catchall fallback and an HTML2 regression test.

Changes:

  • Added a NullComponent catchall fallback to ErrorBoxPolymiddlewareProxy and to useBuildRenderErrorBoxCallback()-built render callbacks.
  • Added an HTML2 test to validate Adaptive Cards render failures don’t produce the RCoR fallthrough warning when <DebugProvider> is absent.
  • Added a changelog entry documenting the fix.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/api-middleware/src/errorBoxPolymiddleware.tsx Adds a null fallback catchall for error box proxy and the render-callback builder hook to avoid RCoR fallthrough surfacing to React runtime.
tests/html2/adaptiveCard/renderError.withoutDebug.html Adds regression coverage for rendering a failing Adaptive Card without <DebugProvider>.
CHANGELOG.md Documents the fix in the changelog.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/api-middleware/src/errorBoxPolymiddleware.tsx
@compulim compulim merged commit 4c60bbe into microsoft:main May 22, 2026
29 checks passed
@compulim compulim deleted the fix-polymiddleware-error branch May 22, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants