Skip to content

preload patchwork-llm library only on idle - #112

Merged
chee merged 1 commit into
mainfrom
llm-preload-needs-idle
Nov 24, 2026
Merged

chee merged 1 commit into
mainfrom
llm-preload-needs-idle

Conversation

@chee

@chee chee commented Nov 24, 2026

Copy link
Copy Markdown
Member

fixes a flaky bench

WebKit has no requestIdleCallback, so the tray fell back to setTimeout(0)
and imported @chee/patchwork-llm mid-boot. Closing that first tab within a
few seconds then left the service worker answering nothing (no fetch, no
postMessage) for every tab on the origin, while it still reported itself
active. That's patchwork-system's webkit closed-tab-persistence e2e, failing
on every run since 0.0.107 ("load on idle"): it passes on 0.0.106 and with
this change, and fails 3/3 on 0.0.186 without it (macOS WebKit). Where
there's no idle callback, the button's hover/focus preload is the only one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@patchcrow

patchcrow commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Patchwork glance ready

https://patchwork-preview-112--patchwork-base.netlify.app

Patchwork from inkandswitch/patchwork.inkandswitch.com, packages from this PR at 568c458.

build-info.json

@chee
chee merged commit bcb13ac into main Nov 24, 2026
6 of 7 checks passed
@chee
chee deleted the llm-preload-needs-idle branch November 24, 2026 14:19
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.

2 participants