Repository navigation
fix(web): prevent Prism worker handler conflict - #3521
Merged
Merged
Conversation
Co-authored-by: OpenBitFun <318544290+bitfun-ai@users.noreply.github.com>
kev1n77
marked this pull request as ready for review
October 22, 2026 07:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
{ id, content, language }worker protocol unchanged.[object Object]JSON parse failure.Fixes #
Type and Areas
Type: Regression fix / test
Areas: Web UI
Motivation / Impact
Prism automatically installs a JSON-based worker handler when it detects a worker. The application already sends structured objects to the same worker, so Prism attempted to run
JSON.parse(event.data)on an object converted to"[object Object]", producing the frontend crash seen in the recent #185 run. The setup module now setsPrism.disableWorkerMessageHandlerbefore Prism is imported, leaving the application's handler as the only message handler.No direct user-facing copy change. ResizeObserver and Peer workspace issues were intentionally not modified.
Verification
pnpm run test:run src/flow_chat/timeline/highlight.worker.test.ts— passed (1 test).pnpm exec tsc --noEmit --target ES2020 --module ESNext --moduleResolution bundler --lib 'es2020,dom,dom.iterable' --strict --skipLibCheck --esModuleInterop --allowSyntheticDefaultImports src/flow_chat/timeline/prismWorkerSetup.ts src/flow_chat/timeline/highlight.worker.ts src/flow_chat/timeline/highlight.worker.test.ts— passed.pnpm run desktop:devwith the requestedprofile-devenvironment — Rust/Tauri build completed and the dev desktop started successfully.highlight.worker.ts?worker_file&type=modulebundle — TypeScript, JSON, Rust, and unknown-language fallback messages all returned; monitored structured-object request returned one response with zero Worker errors.profile-devwebview log inspection — nohighlight.worker, PrismSyntaxError, or"[object Object]" is not valid JSONentry after the fix.Reviewer Notes
upstream/mainbefore pushing.Checklist
Generated with OpenBitFun