Skip to content

Prevent diff-heavy task renderer crash loops#3430

Draft
k11kirky wants to merge 2 commits into
mainfrom
posthog-code/escape-renderer-crash-loop
Draft

Prevent diff-heavy task renderer crash loops#3430
k11kirky wants to merge 2 commits into
mainfrom
posthog-code/escape-renderer-crash-loop

Conversation

@k11kirky

@k11kirky k11kirky commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Problem

Opening a diff-heavy task in the experimental chat thread could crash the Electron renderer. That renderer omitted the worker-pool limit used by the production conversation view, allowing the syntax highlighter to create its much larger default worker pool; recovery then reloaded the same task route and repeated the crash.

Changes

  • Share one bounded diff-worker configuration across both conversation renderers.
  • On a repeated renderer crash, clear the task route instead of reopening the same crashing view.
  • Add regression coverage for the worker limit and recovery sequence.

How did you test this?

  • pnpm exec biome check packages/ui/src/features/sessions/conversationDiffPoolOptions.ts packages/ui/src/features/sessions/conversationDiffPoolOptions.test.ts packages/ui/src/features/sessions/components/ConversationView.tsx packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx
  • pnpm --filter @posthog/ui typecheck
  • pnpm --filter @posthog/ui exec vitest run src/features/sessions/conversationDiffPoolOptions.test.ts src/features/sessions/components/new-thread/buildThreadGroups.test.ts src/features/sessions/components/incrementalConversationItems.test.ts
  • pnpm --filter @posthog/code typecheck
  • pnpm --filter @posthog/code exec vitest run src/main/utils/renderer-crash-recovery.test.ts src/main/utils/crash-diagnostics.test.ts

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Avoid reloading the same task route after a repeated renderer crash, while retaining bounded automatic recovery.

Generated-By: PostHog Code
Task-Id: f0303120-22c3-4c5a-b134-2590d01fdc6e
@trunk-io

trunk-io Bot commented Jul 14, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit f547221.

Share the bounded conversation diff worker configuration across both thread renderers so diff-heavy task histories cannot start the default eight highlighter workers.

Generated-By: PostHog Code
Task-Id: f0303120-22c3-4c5a-b134-2590d01fdc6e
@k11kirky k11kirky changed the title Fix repeated renderer crash recovery loop Prevent diff-heavy task renderer crash loops Jul 14, 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.

1 participant