Skip to content

fix(core): reset flushEpoch on render error so renderer retries instead of freezing#2154

Open
atul-upadhyay-7 wants to merge 3 commits into
Karanjot786:mainfrom
atul-upadhyay-7:fix/renderer-flush-freeze-on-exception
Open

fix(core): reset flushEpoch on render error so renderer retries instead of freezing#2154
atul-upadhyay-7 wants to merge 3 commits into
Karanjot786:mainfrom
atul-upadhyay-7:fix/renderer-flush-freeze-on-exception

Conversation

@atul-upadhyay-7

Copy link
Copy Markdown
Contributor

When _flush() throws before swap() completes, the epoch never advances, so flushEpoch stays equal to the current epoch and all future flushes are silently skipped — the UI freezes permanently.

Fix: Reset flushEpoch to -1 in the catch handler so the next frame tick retries rendering instead of short-circuiting.

Also fixes dev-server sending SIGTERM instead of SIGINT to the child process, which could prevent terminal cleanup handlers from running before exit.

…ad of freezing

Closes Karanjot786#2152

When _flush() throws before swap() completes, the epoch never advances,
so flushEpoch stays equal to the current epoch and all future flushes
are silently skipped — the UI freezes permanently.

Reset flushEpoch to -1 in the catch handler so the next frame tick
retries rendering instead of short-circuiting.

Also fixes dev-server SIGTERM -> SIGINT so child terminal cleanup
handlers run fully before exit.

Closes Karanjot786#2153
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Karanjot786, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 16 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: effe5a8b-bf7a-4ff6-b20a-bb88e15b3d94

📥 Commits

Reviewing files that changed from the base of the PR and between 65d1f7e and ffbeafd.

📒 Files selected for processing (4)
  • packages/core/src/terminal/Renderer.test.ts
  • packages/core/src/terminal/Renderer.ts
  • packages/store/src/store.test.ts
  • packages/store/src/store.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added needs-star PR author has not starred the repo. type:bug +10 pts. Bug fix. labels Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Hi @atul-upadhyay-7 👋

Star this repo before your PR merges.

Why? GSSoC 2026 contributors who star get priority review and points credit. After you star, push any commit (or re-run this check). The needs-star label lifts automatically.

Thanks for your contribution to TermUI.

@github-actions github-actions Bot added area:core @termuijs/core area:dev-server @termuijs/dev-server type:testing +10 pts. Tests. and removed type:bug +10 pts. Bug fix. needs-star PR author has not starred the repo. labels Jul 7, 2026
Strip scope creep from this branch: the store.ts commit/rollback closure
change duplicates PR Karanjot786#2151 (already merged into main), and the dev-server
SIGTERM->SIGINT change was unrelated to the Renderer flushEpoch fix. Both
are reverted to match main so the diff contains only the flushEpoch fix
and its test.

Co-authored-by: Karanjot786 <karanjots801@gmail.com>
@github-actions

Copy link
Copy Markdown

Hi @atul-upadhyay-7 👋

Star this repo before your PR merges.

Why? GSSoC 2026 contributors who star get priority review and points credit. After you star, push any commit (or re-run this check). The needs-star label lifts automatically.

Thanks for your contribution to TermUI.

@Karanjot786

Copy link
Copy Markdown
Owner

Removed unrelated changes from this branch to keep the diff focused:

Kept: the Renderer.ts _flush() fix that resets flushEpoch = -1 on render error so the renderer retries instead of freezing, plus its test. Verified packages/core builds and Renderer.test.ts passes (18/18).

@github-actions github-actions Bot added type:bug +10 pts. Bug fix. needs-star PR author has not starred the repo. labels Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core @termuijs/core area:dev-server @termuijs/dev-server needs-star PR author has not starred the repo. type:bug +10 pts. Bug fix. type:testing +10 pts. Tests.

Projects

None yet

2 participants