Skip to content

fix: keep the pending error flag until the boundary's retry render - #5227

Merged
JoviDeCroock merged 2 commits into
mainfrom
JoviDeCroock/fix-error-boundary-retry-loop
Sep 2, 2026
Merged

fix: keep the pending error flag until the boundary's retry render#5227
JoviDeCroock merged 2 commits into
mainfrom
JoviDeCroock/fix-error-boundary-retry-loop

Conversation

@JoviDeCroock

@JoviDeCroock JoviDeCroock commented Sep 2, 2026

Copy link
Copy Markdown
Member

Note

This PR was authored by an LLM (Claude Fable 5.1) during the v11 release-readiness audit; Jovi reviewed the change and the tests.

Summary

When a descendant throws and a boundary handles it, _catchError sets PENDING_ERROR on the boundary from inside the boundary's own diffChildren call. Since 943fa26 the end of diff() clears PROCESSING_EXCEPTION | PENDING_ERROR unconditionally, so that bit is wiped in the same render that set it. On the retry render the boundary is therefore never marked PROCESSING_EXCEPTION, catches the same error again, enqueues another retry, and loops: one microtask per iteration, forever. A boundary that retries on error hangs the tab instead of letting the error bubble.

v10 captured clearProcessingException = c._pendingError before rendering and only cleared at the end when it was set at the start. This restores that: the bits are cleared only when the render began as the retry.

Test

should skip the boundary when the retry render throws again in componentDidCatch.test.jsx: on main the rerender() call never returns (the test runner hangs); here the second error bubbles to the outer boundary and the inner one catches exactly once.

Core brotli: 4428 → 4426 B.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

📊 Tachometer Benchmark Results

Summary

⏳ Benchmarks are currently running. Results below are out of date.

duration

  • create10k: unsure 🔍 -1% - +1% (-4.71ms - +7.65ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +1% (-0.18ms - +0.15ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +3% (-0.50ms - +1.42ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -3% - +2% (-0.50ms - +0.37ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +1% (-0.54ms - +0.58ms)
    preact-local vs preact-main
  • text-update: faster ✔ 1% - 10% (0.01ms - 0.18ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -5% - +4% (-1.45ms - +1.35ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -2% - +7% (-0.40ms - +1.82ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -7% - +1% (-0.39ms - +0.03ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -2% - +7% (-0.02ms - +0.07ms)
    preact-local vs preact-main
  • todo: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-main

Results

⏳ Benchmarks are currently running. Results below are out of date.
create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local603.25ms - 611.62ms-unsure 🔍
-1% - +1%
-4.71ms - +7.65ms
preact-main601.42ms - 610.52msunsure 🔍
-1% - +1%
-7.65ms - +4.71ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local19.07ms - 19.07ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-main19.07ms - 19.07msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.50ms - 16.77ms-unsure 🔍
-1% - +1%
-0.18ms - +0.15ms
preact-main16.56ms - 16.74msunsure 🔍
-1% - +1%
-0.15ms - +0.18ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.57ms - 1.57ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.57ms - 1.57msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #5877
  • Commit: 0218a0a

duration

VersionAvg timevs preact-localvs preact-main
preact-local48.73ms - 50.05ms-unsure 🔍
-1% - +3%
-0.50ms - +1.42ms
preact-main48.24ms - 49.62msunsure 🔍
-3% - +1%
-1.42ms - +0.50ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local5.03ms - 5.23ms-unsure 🔍
-7% - +1%
-0.39ms - +0.03ms
preact-main5.12ms - 5.49msunsure 🔍
-1% - +8%
-0.03ms - +0.39ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.12ms - 16.80ms-unsure 🔍
-3% - +2%
-0.50ms - +0.37ms
preact-main16.26ms - 16.80msunsure 🔍
-2% - +3%
-0.37ms - +0.50ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.75ms - 3.76ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main3.76ms - 3.76msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #5877
  • Commit: 0218a0a

duration

VersionAvg timevs preact-localvs preact-main
preact-local55.07ms - 55.97ms-unsure 🔍
-1% - +1%
-0.54ms - +0.58ms
preact-main55.17ms - 55.82msunsure 🔍
-1% - +1%
-0.58ms - +0.54ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.03ms - 3.03ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main3.03ms - 3.03msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local25.41ms - 26.09ms-unsure 🔍
-2% - +2%
-0.51ms - +0.57ms
preact-main25.30ms - 26.14msunsure 🔍
-2% - +2%
-0.57ms - +0.51ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local28.81ms - 29.79ms-unsure 🔍
-3% - +2%
-1.01ms - +0.45ms
preact-main29.03ms - 30.12msunsure 🔍
-2% - +3%
-0.45ms - +1.01ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local29.29ms - 30.53ms-unsure 🔍
-2% - +4%
-0.66ms - +1.18ms
preact-main28.98ms - 30.33msunsure 🔍
-4% - +2%
-1.18ms - +0.66ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local24.32ms - 24.93ms-unsure 🔍
-1% - +2%
-0.24ms - +0.47ms
preact-main24.33ms - 24.70msunsure 🔍
-2% - +1%
-0.47ms - +0.24ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local25.93ms - 26.80ms-unsure 🔍
-1% - +3%
-0.35ms - +0.85ms
preact-main25.70ms - 26.52msunsure 🔍
-3% - +1%
-0.85ms - +0.35ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local19.88ms - 20.33ms-unsure 🔍
-1% - +1%
-0.27ms - +0.28ms
preact-main19.94ms - 20.25msunsure 🔍
-1% - +1%
-0.28ms - +0.27ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 210
  • Built by: CI #5877
  • Commit: 0218a0a

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.69ms - 1.80ms-faster ✔
1% - 10%
0.01ms - 0.18ms
preact-main1.77ms - 1.90msslower ❌
0% - 10%
0.01ms - 0.18ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.08ms - 1.15ms-unsure 🔍
-2% - +7%
-0.02ms - +0.07ms
preact-main1.06ms - 1.12msunsure 🔍
-6% - +2%
-0.07ms - +0.02ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local30.96ms - 32.82ms-unsure 🔍
-5% - +4%
-1.45ms - +1.35ms
preact-main30.89ms - 32.98msunsure 🔍
-4% - +5%
-1.35ms - +1.45ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.27ms - 1.27ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-main1.27ms - 1.27msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-
update10th1k
  • Browser: chrome-headless
  • Sample size: 150
  • Built by: CI #5877
  • Commit: 0218a0a

duration

VersionAvg timevs preact-localvs preact-main
preact-local26.97ms - 28.57ms-unsure 🔍
-2% - +7%
-0.40ms - +1.82ms
preact-main26.30ms - 27.84msunsure 🔍
-6% - +1%
-1.82ms - +0.40ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.97ms - 2.98ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-main2.97ms - 2.97msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-

tachometer-reporter-action v2 for CI

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Size Change: +4 B (+0.03%)

Total Size: 15.9 kB

📦 View Changed
Filename Size Change
dist/preact.mjs 4.89 kB +4 B (+0.08%)
ℹ️ View Unchanged
Filename Size
compat/dist/compat.mjs 3.9 kB
debug/dist/debug.mjs 3.88 kB
devtools/dist/devtools.mjs 273 B
hooks/dist/hooks.mjs 1.58 kB
jsx-runtime/dist/jsxRuntime.mjs 868 B
test-utils/dist/testUtils.mjs 473 B

compressed-size-action

@coveralls

coveralls commented Sep 2, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 99.534%. remained the same — JoviDeCroock/fix-error-boundary-retry-loop into main

@JoviDeCroock
JoviDeCroock merged commit ec2f5fb into main Sep 2, 2026
13 checks passed
@JoviDeCroock
JoviDeCroock deleted the JoviDeCroock/fix-error-boundary-retry-loop branch September 2, 2026 17:17
@JoviDeCroock JoviDeCroock mentioned this pull request Sep 6, 2026
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