Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .changeset/automerge-worker-nudge-grace.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/coalesce-package-lookups.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/package-lookup-reason.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/pinned-path-cache.md

This file was deleted.

20 changes: 20 additions & 0 deletions core/bootloader/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# @inkandswitch/patchwork-bootloader

## 0.8.5

### Patch Changes

- 3d2d0b0: The service worker no longer mistakes a booting automerge worker for a missing one. The worker only asked for its lock once its whole import graph (most of a megabyte) had loaded, so asset requests made in that window found no lock and logged "no automerge worker; asking tabs to start one". Each tab then dropped its connection to the booting worker and reconnected sync. In a single tab that happened on every reload.

The worker's script, `automerge-protocol-handler-worker.js`, is now a small module that takes the lock and holds on to connecting tabs before it imports the worker itself, now `@inkandswitch/patchwork-bootloader/automerge-protocol-handler`. The vite plugin emits that as a second file, `automerge-protocol-handler.js`, beside the first. As a backstop, the service worker waits three seconds before nudging, and only nudges if the request is still unanswered and there's still no lock. The nudge is throttled to once every five seconds, however many requests are waiting. Before, every request that raced the same cold start got past the throttle and logged its own nudge.

The e2e suite gains `automerge-worker.spec.ts`, which checks that the worker holds its lock once a tab is up and that a request racing a cold worker boot isn't reported as a missing worker.

- 3d2d0b0: Package heads lookups no longer pile up on a busy automerge worker. A package doc that's still syncing, as everything is on a fresh login, reports a change with every batch that arrives. The `ModuleWatcher` started a lookup for each one, and the automerge worker ran each as a full resolve with its own 30-second timeout. A worker slowed by the login sync then timed them all out, and each logged its own 557.

The `ModuleWatcher` now runs one change-triggered lookup per package at a time. Changes that land while one is in flight collapse into a single lookup after it. The automerge worker shares one resolve between concurrent requests for the same package url without heads, so tabs asking at once wait on the same lookup.

- Only cache resolved paths when the root and every followed link pin their document heads.
- Updated dependencies [3d2d0b0]
- Updated dependencies [3d2d0b0]
- Updated dependencies
- @inkandswitch/patchwork-filesystem@0.2.14

## 0.8.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion core/bootloader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "git+https://github.com/inkandswitch/patchwork-system.git",
"directory": "core/bootloader"
},
"version": "0.8.4",
"version": "0.8.5",
"author": "chee",
"type": "module",
"license": "MIT",
Expand Down
11 changes: 11 additions & 0 deletions core/filesystem/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @inkandswitch/patchwork-filesystem

## 0.2.14

### Patch Changes

- 3d2d0b0: Package heads lookups no longer pile up on a busy automerge worker. A package doc that's still syncing, as everything is on a fresh login, reports a change with every batch that arrives. The `ModuleWatcher` started a lookup for each one, and the automerge worker ran each as a full resolve with its own 30-second timeout. A worker slowed by the login sync then timed them all out, and each logged its own 557.

The `ModuleWatcher` now runs one change-triggered lookup per package at a time. Changes that land while one is in flight collapse into a single lookup after it. The automerge worker shares one resolve between concurrent requests for the same package url without heads, so tabs asking at once wait on the same lookup.

- 3d2d0b0: When the service worker can't redirect a package url to its heads, the error now includes the automerge worker's reason (the first line of its 557 body — e.g. the doc is unavailable, or the resolve timed out) instead of only the status.
- Only cache resolved paths when the root and every followed link pin their document heads.

## 0.2.13

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion core/filesystem/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"directory": "core/filesystem"
},
"type": "module",
"version": "0.2.13",
"version": "0.2.14",
"author": "Ink & Switch",
"description": "",
"main": "dist/index.js",
Expand Down
17 changes: 17 additions & 0 deletions core/patchwork/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# @inkandswitch/patchwork

## 0.8.7

### Patch Changes

- 3d2d0b0: The service worker no longer mistakes a booting automerge worker for a missing one. The worker only asked for its lock once its whole import graph (most of a megabyte) had loaded, so asset requests made in that window found no lock and logged "no automerge worker; asking tabs to start one". Each tab then dropped its connection to the booting worker and reconnected sync. In a single tab that happened on every reload.

The worker's script, `automerge-protocol-handler-worker.js`, is now a small module that takes the lock and holds on to connecting tabs before it imports the worker itself, now `@inkandswitch/patchwork-bootloader/automerge-protocol-handler`. The vite plugin emits that as a second file, `automerge-protocol-handler.js`, beside the first. As a backstop, the service worker waits three seconds before nudging, and only nudges if the request is still unanswered and there's still no lock. The nudge is throttled to once every five seconds, however many requests are waiting. Before, every request that raced the same cold start got past the throttle and logged its own nudge.

The e2e suite gains `automerge-worker.spec.ts`, which checks that the worker holds its lock once a tab is up and that a request racing a cold worker boot isn't reported as a missing worker.

- Updated dependencies [3d2d0b0]
- Updated dependencies [3d2d0b0]
- Updated dependencies [3d2d0b0]
- Updated dependencies
- @inkandswitch/patchwork-bootloader@0.8.5
- @inkandswitch/patchwork-filesystem@0.2.14

## 0.8.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion core/patchwork/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "git+https://github.com/inkandswitch/patchwork-system.git",
"directory": "core/patchwork"
},
"version": "0.8.6",
"version": "0.8.7",
"author": "Ink & Switch",
"type": "module",
"license": "MIT",
Expand Down
10 changes: 10 additions & 0 deletions packages/e2e/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @inkandswitch/patchwork-e2e

## 0.2.3

### Patch Changes

- 3d2d0b0: The service worker no longer mistakes a booting automerge worker for a missing one. The worker only asked for its lock once its whole import graph (most of a megabyte) had loaded, so asset requests made in that window found no lock and logged "no automerge worker; asking tabs to start one". Each tab then dropped its connection to the booting worker and reconnected sync. In a single tab that happened on every reload.

The worker's script, `automerge-protocol-handler-worker.js`, is now a small module that takes the lock and holds on to connecting tabs before it imports the worker itself, now `@inkandswitch/patchwork-bootloader/automerge-protocol-handler`. The vite plugin emits that as a second file, `automerge-protocol-handler.js`, beside the first. As a backstop, the service worker waits three seconds before nudging, and only nudges if the request is still unanswered and there's still no lock. The nudge is throttled to once every five seconds, however many requests are waiting. Before, every request that raced the same cold start got past the throttle and logged its own nudge.

The e2e suite gains `automerge-worker.spec.ts`, which checks that the worker holds its lock once a tab is up and that a request racing a cold worker boot isn't reported as a missing worker.

## 0.2.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "git+https://github.com/inkandswitch/patchwork-system.git",
"directory": "packages/e2e"
},
"version": "0.2.2",
"version": "0.2.3",
"type": "module",
"description": "Browser + Service-Worker end-to-end sync tests (Playwright) for a Patchwork site.",
"bin": {
Expand Down
Loading