Skip to content

fix: keep the 200 newest errors - #47

Merged
lxsmnsyc merged 1 commit into
mainfrom
fix/cap-error-list
Nov 4, 2026
Merged

lxsmnsyc merged 1 commit into
mainfrom
fix/cap-error-list

Conversation

@lxsmnsyc

@lxsmnsyc lxsmnsyc commented Nov 4, 2026

Copy link
Copy Markdown
Member

What and why

Every error the toolbar caught was added to its list, and nothing was ever dropped. An error thrown on every frame of a loop grew the list, and the memory it holds, without end. A review of #45 found this.

Changes

  • src/dev-toolbar/error-list.ts: addError(list, error, max = 200) puts the new error first and keeps the 200 newest. 200 is the same limit as MAX_RECORDS in the async history.
  • pushError uses it.

Proof

  • The new e2e test "keeps the newest errors when an error repeats in a loop" dispatches 205 errors. On main the Errors tab counts 205. Here it counts 200 and shows the newest ("frame 205") first.
  • Unit tests in error-list.test.ts cover the order, the drop and the default limit.
  • pnpm format:check, pnpm typecheck, pnpm build, pnpm test and pnpm test:e2e (24 tests) pass.

Risk

  • The session report's "N errors in all" now counts at most 200.

Review

🤖 Generated with Claude Code

@lxsmnsyc
lxsmnsyc marked this pull request as ready for review November 4, 2026 04:48
Every caught error was added to the list and nothing was ever dropped, so
an error thrown on each frame of a loop grew it without end. The list now
keeps the 200 newest, the same limit the async history uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lxsmnsyc
lxsmnsyc merged commit 368b4c9 into main Nov 4, 2026
3 checks passed
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.

1 participant