Skip to content

Commit ff6e795

Browse files
Version Packages
1 parent 0bb9b54 commit ff6e795

12 files changed

Lines changed: 193 additions & 129 deletions

File tree

.changeset/eighty-jars-shave.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

.changeset/lucky-moons-shave.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

.changeset/olive-pumas-repeat.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

.changeset/rotten-donkeys-repeat.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

packages/hyperbook/CHANGELOG.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,68 @@
11
# hyperbook
22

3+
## 0.100.4
4+
5+
### Patch Changes
6+
7+
- [`d91255b`](https://github.com/openpatch/hyperbook/commit/d91255bb77ce954056c8caa7780a1e7048e60b9d) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Improve the cloud sync indicator:
8+
9+
- Each sync state now has its own badge shape on the toolbar icon. Every state
10+
previously rendered the identical person glyph, distinguished only by fill
11+
color, so amber "unsynced" and green "synced" were indistinguishable to a
12+
red-green color blind reader.
13+
- Sync states a reader can act on are now surfaced outside the user drawer.
14+
Being offline or failing to save was only visible in a drawer most readers
15+
never open. The notice offers a retry when a save fails, and says how much is
16+
waiting while offline. Successful saves stay silent.
17+
- A sync conflict no longer reloads the page without warning. The merge is
18+
explained first, with a "Reload now" button, and the reload follows a few
19+
seconds later. Reloading is still necessary because directives read the store
20+
once at startup, but it is no longer a surprise.
21+
- The toolbar button carries an accessible name that tracks the sync state, and
22+
the status line is an `aria-live` region, so a change is announced rather than
23+
only shown.
24+
- The status line reports what it already knew but discarded: how long ago the
25+
last save landed, and how many batches are waiting while offline. "Saved
26+
locally" alone read as "you are all done".
27+
- The toolbar icon no longer stops updating when the shell is rendered without
28+
the user drawer.
29+
- Status colors meet WCAG AA contrast and follow the light/dark theme; they
30+
were fixed mid-tones at roughly 2-3:1 on white.
31+
- `hyperbook.i18n.get` honors its fallback argument. Ten call sites in the
32+
cloud UI passed one, but the parameter did not exist, so a missing key
33+
rendered the raw key id.
34+
- The impersonation banner offsets only the element after it, not every
35+
following sibling, and builds its markup as nodes instead of interpolating
36+
the username into `innerHTML`.
37+
38+
- [`d91255b`](https://github.com/openpatch/hyperbook/commit/d91255bb77ce954056c8caa7780a1e7048e60b9d) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Fix several data-loss and corruption bugs in cloud sync:
39+
40+
- Loading from the cloud no longer fails whenever the server has events but no
41+
snapshot. The reconstruction the server builds from an event log alone
42+
carries a placeholder database version, which `import` rejected outright —
43+
so a user's work synced up but never came back down, silently, until
44+
something happened to post a full snapshot.
45+
- The event watermark is now stored per hyperbook. Two hyperbooks served from
46+
the same origin shared one `localStorage` key, so each sent the other's
47+
`afterEventId` and got stuck in a permanent conflict loop.
48+
- A sync conflict no longer discards local work. The client now pulls the
49+
server state, replays its pending events on top of it locally and remotely,
50+
and only then reloads.
51+
- Offline batches now chain onto the watermark each one returns. Every batch
52+
after the first previously carried a watermark recorded before the flush and
53+
was rejected, discarding the whole queue.
54+
- Events now carry their Dexie primary-key schema, so the server can replay
55+
onto a table it has no snapshot for without assuming the key field is `id`.
56+
- Ephemeral `currentState` (cursor, scroll, window size) is no longer included
57+
in cloud snapshots; it was already excluded from events.
58+
- A batch rejected with a 4xx is dropped instead of being retried forever, and
59+
a 404 from the cloud no longer throws a `TypeError` that looked transient.
60+
- Concurrent `online` events can no longer start two overlapping queue flushes.
61+
- Closing the tab now flushes pending changes with a `keepalive` request
62+
instead of only warning. Anything changed inside the debounce window was
63+
lost when the tab closed, and `beforeunload` never fires at all on mobile
64+
Safari or when a background tab is discarded.
65+
366
## 0.100.3
467

568
### Patch Changes

packages/hyperbook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hyperbook",
3-
"version": "0.100.3",
3+
"version": "0.100.4",
44
"author": "Mike Barkmin",
55
"homepage": "https://github.com/openpatch/hyperbook#readme",
66
"license": "MIT",

packages/markdown/CHANGELOG.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,68 @@
11
# @hyperbook/markdown
22

3+
## 0.71.4
4+
5+
### Patch Changes
6+
7+
- [`d91255b`](https://github.com/openpatch/hyperbook/commit/d91255bb77ce954056c8caa7780a1e7048e60b9d) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Improve the cloud sync indicator:
8+
9+
- Each sync state now has its own badge shape on the toolbar icon. Every state
10+
previously rendered the identical person glyph, distinguished only by fill
11+
color, so amber "unsynced" and green "synced" were indistinguishable to a
12+
red-green color blind reader.
13+
- Sync states a reader can act on are now surfaced outside the user drawer.
14+
Being offline or failing to save was only visible in a drawer most readers
15+
never open. The notice offers a retry when a save fails, and says how much is
16+
waiting while offline. Successful saves stay silent.
17+
- A sync conflict no longer reloads the page without warning. The merge is
18+
explained first, with a "Reload now" button, and the reload follows a few
19+
seconds later. Reloading is still necessary because directives read the store
20+
once at startup, but it is no longer a surprise.
21+
- The toolbar button carries an accessible name that tracks the sync state, and
22+
the status line is an `aria-live` region, so a change is announced rather than
23+
only shown.
24+
- The status line reports what it already knew but discarded: how long ago the
25+
last save landed, and how many batches are waiting while offline. "Saved
26+
locally" alone read as "you are all done".
27+
- The toolbar icon no longer stops updating when the shell is rendered without
28+
the user drawer.
29+
- Status colors meet WCAG AA contrast and follow the light/dark theme; they
30+
were fixed mid-tones at roughly 2-3:1 on white.
31+
- `hyperbook.i18n.get` honors its fallback argument. Ten call sites in the
32+
cloud UI passed one, but the parameter did not exist, so a missing key
33+
rendered the raw key id.
34+
- The impersonation banner offsets only the element after it, not every
35+
following sibling, and builds its markup as nodes instead of interpolating
36+
the username into `innerHTML`.
37+
38+
- [`d91255b`](https://github.com/openpatch/hyperbook/commit/d91255bb77ce954056c8caa7780a1e7048e60b9d) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Fix several data-loss and corruption bugs in cloud sync:
39+
40+
- Loading from the cloud no longer fails whenever the server has events but no
41+
snapshot. The reconstruction the server builds from an event log alone
42+
carries a placeholder database version, which `import` rejected outright —
43+
so a user's work synced up but never came back down, silently, until
44+
something happened to post a full snapshot.
45+
- The event watermark is now stored per hyperbook. Two hyperbooks served from
46+
the same origin shared one `localStorage` key, so each sent the other's
47+
`afterEventId` and got stuck in a permanent conflict loop.
48+
- A sync conflict no longer discards local work. The client now pulls the
49+
server state, replays its pending events on top of it locally and remotely,
50+
and only then reloads.
51+
- Offline batches now chain onto the watermark each one returns. Every batch
52+
after the first previously carried a watermark recorded before the flush and
53+
was rejected, discarding the whole queue.
54+
- Events now carry their Dexie primary-key schema, so the server can replay
55+
onto a table it has no snapshot for without assuming the key field is `id`.
56+
- Ephemeral `currentState` (cursor, scroll, window size) is no longer included
57+
in cloud snapshots; it was already excluded from events.
58+
- A batch rejected with a 4xx is dropped instead of being retried forever, and
59+
a 404 from the cloud no longer throws a `TypeError` that looked transient.
60+
- Concurrent `online` events can no longer start two overlapping queue flushes.
61+
- Closing the tab now flushes pending changes with a `keepalive` request
62+
instead of only warning. Anything changed inside the debounce window was
63+
lost when the tab closed, and `beforeunload` never fires at all on mobile
64+
Safari or when a background tab is discarded.
65+
366
## 0.71.3
467

568
### Patch Changes

packages/markdown/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hyperbook/markdown",
3-
"version": "0.71.3",
3+
"version": "0.71.4",
44
"author": "Mike Barkmin",
55
"homepage": "https://github.com/openpatch/hyperbook#readme",
66
"license": "MIT",

platforms/cloud/CHANGELOG.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,61 @@
11
# @hyperbook/cloud
22

3+
## 0.0.2
4+
5+
### Patch Changes
6+
7+
- [`9df0010`](https://github.com/openpatch/hyperbook/commit/9df00101a871f9298664790411ee33ad81218d45) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Make the cloud server easier to run and safer to update:
8+
9+
- Published as a container image per release. `docker compose up -d` is the
10+
whole deployment, and `docker compose pull && docker compose up -d` the whole
11+
update. An image tag is something to pin, which tracking `main` never was.
12+
`docker-compose.yml`, a `Dockerfile` and an `ecosystem.config.js` for
13+
non-container deployments are committed rather than pasted from the README.
14+
- The schema is versioned with `PRAGMA user_version` instead of re-deriving
15+
itself from `CREATE TABLE IF NOT EXISTS` and column probes on every boot.
16+
Each migration runs at most once, in order, and the version is recorded only
17+
after the step succeeds, so an interrupted upgrade retries rather than skips.
18+
- **The database is copied aside before any migration that has work to do**,
19+
with `VACUUM INTO`. If the copy cannot be written, the migration does not
20+
run. The five most recent backups are kept.
21+
- Starting a build older than the one that last wrote the database is refused,
22+
instead of silently reading a schema it does not understand.
23+
- In production the server refuses to start when `JWT_SECRET` is missing or
24+
still the placeholder, when it is shorter than 32 characters, when `BASE_URL`
25+
is unset, or when SMTP is half configured. It prints every problem at once
26+
and suggests a generated secret. Previously a deployment that forgot
27+
`JWT_SECRET` ran with a value published in this repository, and said nothing.
28+
- `engines` now records the Node versions `better-sqlite3` can be built
29+
against, so a mismatch fails at install rather than at `require`.
30+
31+
- [`d91255b`](https://github.com/openpatch/hyperbook/commit/d91255bb77ce954056c8caa7780a1e7048e60b9d) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Fix event replay corrupting the state it reconstructs:
32+
33+
- The primary key is now parsed out of the Dexie schema string. Taking the
34+
first field verbatim left the markers on (`++id`, `&email`, `*tags`), so the
35+
key matched no row property at all and every update and delete missed
36+
silently while creates piled up duplicates. Compound keys (`[a+b]`) and
37+
outbound keys are handled too.
38+
- A created row can no longer end up without its primary key, which made it
39+
unreachable to every later event.
40+
- Primary keys keep their type. `prim_key` stored `String(primKey)`, flattening
41+
numeric and compound keys so they no longer matched the rows they addressed;
42+
events now also carry `prim_key_json`.
43+
- Replay is idempotent. `create` appended unconditionally, so a retried or
44+
replayed batch duplicated rows; it now upserts.
45+
- Dexie's dotted update paths (`update(id, {"state.zoom": 2})`) are applied to
46+
the nested field instead of being written as a literal `"state.zoom"`
47+
property.
48+
- Events carry the client's Dexie primary-key schema, so a table with no prior
49+
snapshot is no longer assumed to be keyed by `id`. Tables keyed by something
50+
else — `bookmarks` by `path`, `onlineide` by `scriptId` — had a bogus `id`
51+
stamped onto every row.
52+
- The `afterEventId` check and the append now share one transaction. Two
53+
clients writing at the same moment could both pass the check and interleave.
54+
- A malformed batch is rejected with 400 instead of failing a CHECK constraint
55+
and returning 500, which the client treated as transient and retried forever.
56+
57+
Both new columns are added by migration; existing databases keep working.
58+
359
## 0.0.1
460

561
### Patch Changes

platforms/cloud/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hyperbook/cloud",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"private": true,
55
"engines": {
66
"node": ">=20"

0 commit comments

Comments
 (0)