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
35 changes: 32 additions & 3 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ on 0.12. `pins.test.ts` checks it is exact as well. Pick the versions that agree
persistence-core 0.4.3 (browser persistence 0.2.28) and offline-transactions 1.0.61.
`npm view <pkg>@<v> dependencies` says which core each release is built on.

**Not 0.12, and still not as of 0.15.1 (2026-10-16).** 0.12.0 removes `begin({ immediate })`
**Not 0.12, and still not as of 1.0.0-rc.1.5 (2026-11-11).** The 1.0 release candidate is
npm's `latest` now, and `offline-transactions` 1.2 peers on `^1.0.0-rc.0`; neither brings
`begin({ immediate })` back, so `pnpm outdated` listing them is not a reason to move. 0.12.0 removes `begin({ immediate })`
from the sync API and queues sync writes behind any mutation in flight; nothing since brings
either back. `feedControls` begins every transaction immediate because, without it, a page of
the feed waited on the outbox entry that was itself waiting for that page: a second queued
Expand Down Expand Up @@ -70,7 +72,7 @@ it only made every move of the family one package wider. Adding it back for `use
puts it in this family, at the version built on the same core.

**`@journeyapps/wa-sqlite` ^1.** The persistence adapter peers on `^1.4.1` (still so in
0.2.35, 2026-10-16). 2.0 updates PowerSync's own SQLite extension and their write-ahead VFS, neither
0.2.37 and in 1.0.0-rc.1.5, 2026-11-11). 2.0 updates PowerSync's own SQLite extension and their write-ahead VFS, neither
of which is used here. Released when the adapter's peer range takes 2; Dependabot ignores
the major until then.

Expand All @@ -85,10 +87,32 @@ runtime modules to that. vite-plugin-pwa 2.0.0 still carries Workbox 7.4.1.
## Auth: Better Auth

**The family moves in lockstep:** `better-auth`, `@better-auth/mcp`,
`@better-auth/oauth-provider` and `@better-auth/passkey`, all at one version (1.7.10). A core
`@better-auth/oauth-provider` and `@better-auth/passkey`, all at one version (1.7.21). A core
a version ahead of its plugins breaks the types in `apps/api/src/auth.ts`. `passkey` is
written exactly, the others with `^`; move them all together either way.

## The Workers runtime: Wrangler and the vitest plugin

**`wrangler` 4.151.1 and `@cloudflare/vitest-plugin` 1.4.4, both exactly.** Each brings its
own workerd, and every workerd from 1.20261106 on carries SQLite 3.54.1 (workerd #8239),
under which the store's search fails with "VIEWs and/or subqueries nested too deep". The
statement is `NotesStore.search`'s four tiers, MATERIALIZED CTEs feeding one another
(`note_hits`, `early`, `earlier`, `combined`, `best`), and it fails whatever the data.
Measured 2026-11-11: on plugin 1.8.0 (workerd 1.20261110.1) eleven store tests fail, every
one in a search, on vitest 5.0.3 as on 5.1.0; with that plugin's miniflare forced back to
5.20261104.0-beta, the attachments file's three failures pass. Wrangler matters as much as
the plugin, because `pnpm dev` runs the Worker on Wrangler's workerd, so search on a local
instance fails the same way. The newest releases still on an older workerd are plugin 1.6.0
and Wrangler 4.158.0 (both miniflare 5.20261104.0-beta); neither was taken, and the versions
pinned are the ones tested.

The runtime is not only local. Cloudflare's production runtime is the same workerd, so
unbent.app gets SQLite 3.54.1 when that release is deployed, and its search with it, whatever
this pin says. The pin keeps a local instance and the store tests on a SQLite where search
works; the fix is to reshape the statement until it prepares on 3.54.1. Lift the pin with
that fix: move the plugin and Wrangler to their newest, clear `node_modules/.vitest-cache`,
and `pnpm --filter @unbent/store-tests test` must pass, search tests included.

## Tooling

**Wrangler comes from the lockfile.** It is a devDependency of `apps/api`; run it with
Expand All @@ -112,6 +136,11 @@ the workspace holds one vitest; a `pnpm -r update vitest` would move them and le
it when a plugin release passes `pnpm --filter @unbent/store-tests test` on the newer vitest,
run from a cleared `node_modules/.vitest-cache`.

Rechecked 2026-11-11 against vitest 5.1.0: still broken, on plugin 1.6.0 and on 1.8.0 alike,
each losing the same eight of seventeen files to "Worker exited unexpectedly". (1.8.0 fails
the search tests besides, for the runtime reason above.) Keep vitest at 5.0.3; plugin 1.4.4
is exact now for the runtime's sake, which this hold also needs.

## The workflows' actions

**Every `uses:` in `.github/workflows/` names a commit SHA, with the version beside it as
Expand Down
18 changes: 9 additions & 9 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@
"release": "wrangler deploy --env \"\""
},
"dependencies": {
"@better-auth/mcp": "^1.7.10",
"@better-auth/oauth-provider": "^1.7.10",
"@better-auth/passkey": "1.7.10",
"@better-auth/mcp": "^1.7.21",
"@better-auth/oauth-provider": "^1.7.21",
"@better-auth/passkey": "1.7.21",
"@hono/zod-validator": "^0.9.1",
"@modelcontextprotocol/server": "^2.3.1",
"@modelcontextprotocol/server": "^2.4.0",
"@unbent/clip": "workspace:*",
"@unbent/enex": "workspace:*",
"@unbent/shared": "workspace:*",
"better-auth": "^1.7.10",
"hono": "^4.13.13",
"better-auth": "^1.7.21",
"hono": "^4.13.18",
"zod": "^4.6.7"
},
"devDependencies": {
"@cloudflare/workers-types": "^5.20261016.1",
"@types/node": "^26.6.5",
"@cloudflare/workers-types": "^5.20261110.1",
"@types/node": "^26.6.6",
"@zip.js/zip.js": "^2.24.0",
"tsx": "^4.23.15",
"typescript": "^7.0.2",
"vitest": "^5.0.3",
"wrangler": "^4.151.1"
"wrangler": "4.151.1"
},
"exports": {
".": "./src/index.ts",
Expand Down
31 changes: 22 additions & 9 deletions apps/api/src/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,18 @@ describe('socialConfig for Apple', () => {
* `exact-or-sha256` comparison exists for.
*/
it('verifies a native token for the bundle id, with its hashed nonce', async () => {
const keys = (await crypto.subtle.generateKey({ name: 'ECDSA', namedCurve: 'P-256' }, true, [
'sign',
'verify',
])) as CryptoKeyPair;
const keys = (await crypto.subtle.generateKey(
{
name: 'RSASSA-PKCS1-v1_5',
modulusLength: 2048,
publicExponent: new Uint8Array([1, 0, 1]),
hash: 'SHA-256',
},
true,
['sign', 'verify'],
)) as CryptoKeyPair;
const nonce = 'raw-nonce';
const sign = (claims: Record<string, unknown>) => es256(keys.privateKey, claims);
const sign = (claims: Record<string, unknown>) => rs256(keys.privateKey, claims);
const now = Math.floor(Date.now() / 1000);
const claims = {
iss: 'https://appleid.apple.com',
Expand Down Expand Up @@ -236,12 +242,19 @@ async function sha256Hex(value: string): Promise<string> {
return [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, '0')).join('');
}

/** A compact ES256 JWT, signed with Web Crypto rather than a JOSE library. */
async function es256(key: CryptoKey, claims: Record<string, unknown>): Promise<string> {
/**
* A compact RS256 JWT, signed with Web Crypto rather than a JOSE library.
*
* RS256 because that is what Apple signs with, and since Better Auth 1.7.12 the
* algorithm comes from the provider's configuration rather than the token's header: a
* token in any other algorithm is refused before its audience is looked at. This was
* ES256 until then, which passed only because the header was trusted.
*/
async function rs256(key: CryptoKey, claims: Record<string, unknown>): Promise<string> {
const part = (value: unknown) => Buffer.from(JSON.stringify(value)).toString('base64url');
const input = `${part({ alg: 'ES256', kid: 'test' })}.${part(claims)}`;
const input = `${part({ alg: 'RS256', kid: 'test' })}.${part(claims)}`;
const signature = await crypto.subtle.sign(
{ name: 'ECDSA', hash: 'SHA-256' },
{ name: 'RSASSA-PKCS1-v1_5' },
key,
new TextEncoder().encode(input),
);
Expand Down
4 changes: 2 additions & 2 deletions apps/store-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"test": "vitest run"
},
"devDependencies": {
"@cloudflare/vitest-plugin": "^1.4.4",
"@cloudflare/workers-types": "^5.20261016.1",
"@cloudflare/vitest-plugin": "1.4.4",
"@cloudflare/workers-types": "^5.20261110.1",
"@unbent/api": "workspace:*",
"@unbent/shared": "workspace:*",
"typescript": "^7.0.2",
Expand Down
36 changes: 18 additions & 18 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,36 @@
"compat:bump": "UNBENT_COMPAT=bump vitest run src/compat/contract.test.ts"
},
"dependencies": {
"@better-auth/oauth-provider": "^1.7.10",
"@better-auth/passkey": "1.7.10",
"@better-auth/oauth-provider": "^1.7.21",
"@better-auth/passkey": "1.7.21",
"@codemirror/commands": "^6.11.1",
"@codemirror/lang-markdown": "^6.5.2",
"@codemirror/language": "^6.13.1",
"@codemirror/language-data": "^6.5.2",
"@codemirror/state": "^6.7.6",
"@codemirror/view": "^6.43.14",
"@codemirror/view": "^6.43.15",
"@journeyapps/wa-sqlite": "^1.7.2",
"@lezer/markdown": "^1.8.0",
"@lezer/markdown": "^1.8.1",
"@tanstack/browser-db-sqlite-persistence": "0.2.28",
"@tanstack/db": "0.11.3",
"@tanstack/offline-transactions": "1.0.61",
"@tanstack/react-query": "^5.104.3",
"@tanstack/react-router": "^1.170.45",
"@tanstack/react-query": "^5.107.1",
"@tanstack/react-router": "^1.170.46",
"@unbent/api": "workspace:*",
"@unbent/clip": "workspace:*",
"@unbent/enex": "workspace:*",
"@unbent/seed": "workspace:*",
"@unbent/shared": "workspace:*",
"@zip.js/zip.js": "^2.24.0",
"better-auth": "^1.7.10",
"better-auth": "^1.7.21",
"codemirror": "^6.0.2",
"diff": "^9.0.0",
"downshift": "^9.4.0",
"downshift": "^9.5.0",
"frimousse": "^0.4.0",
"hono": "^4.13.13",
"lucide-react": "^1.58.0",
"pdfjs-dist": "^6.4.299",
"posthog-js": "^1.438.12",
"hono": "^4.13.18",
"lucide-react": "^1.72.0",
"pdfjs-dist": "^6.5.438",
"posthog-js": "^1.447.12",
"react": "^19.3.1",
"react-dom": "^19.3.1",
"rehype-sanitize": "^6.0.0",
Expand All @@ -56,16 +56,16 @@
"zod": "^4.6.7"
},
"devDependencies": {
"@cloudflare/workers-types": "^5.20261016.1",
"@posthog/cli": "^0.18.10",
"@tanstack/router-plugin": "^1.168.47",
"@cloudflare/workers-types": "^5.20261110.1",
"@posthog/cli": "^0.19.3",
"@tanstack/router-plugin": "^1.169.0",
"@testing-library/react": "^16.3.3",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.1.2",
"jsdom": "^30.1.3",
"@vitejs/plugin-react": "^6.3.0",
"jsdom": "^31.0.0",
"typescript": "^7.0.2",
"vite": "^8.3.4",
"vite": "^8.3.8",
"vite-plugin-pwa": "2.0.0",
"vitest": "^5.0.3",
"workbox-expiration": "7.4.1",
Expand Down
7 changes: 5 additions & 2 deletions apps/web/src/components/Sheet.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ describe('Sheet', () => {
const el = grip(container);
fireEvent.pointerDown(el, { clientY: 100, button: 0, pointerId: 1 });
fireEvent.pointerMove(el, { clientY: 140, pointerId: 1 });
expect(dialogOf(container).style.translate).toBe('0 40px');
// Read back as a browser serializes the `0 40px` the sheet writes: jsdom 31 does
// too, where 30 handed the string back as written.
expect(dialogOf(container).style.translate).toBe('0px 40px');
expect(dialogOf(container).hasAttribute('data-dragging')).toBe(true);
});

Expand Down Expand Up @@ -204,7 +206,8 @@ describe('Sheet', () => {
const el = grip(container);
fireEvent.pointerDown(el, { clientY: 200, button: 0, pointerId: 1 });
fireEvent.pointerMove(el, { clientY: 100, pointerId: 1 });
expect(dialogOf(container).style.translate).toBe('0 0px');
// `0 0px` as written, serialized as a browser does.
expect(dialogOf(container).style.translate).toBe('0px');
fireEvent.pointerUp(el, { clientY: 100, pointerId: 1 });
expect(onClose).not.toHaveBeenCalled();
});
Expand Down
8 changes: 4 additions & 4 deletions packages/clip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"dependencies": {
"@mozilla/readability": "^0.6.0",
"@unbent/shared": "workspace:*",
"hast-util-from-html": "^2.0.3",
"hast-util-from-html": "^2.1.0",
"hast-util-to-mdast": "^10.1.2",
"linkedom": "^0.18.14",
"linkedom": "^0.18.15",
"mdast-util-gfm": "^3.1.0",
"mdast-util-to-markdown": "^2.2.0",
"unist-util-visit": "^5.1.0"
"mdast-util-to-markdown": "^2.2.3",
"unist-util-visit": "^5.2.0"
},
"devDependencies": {
"typescript": "^7.0.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/enex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"@unbent/clip": "workspace:*",
"@unbent/shared": "workspace:*",
"@zip.js/zip.js": "^2.24.0",
"hast-util-from-html": "^2.0.3",
"pdfjs-dist": "^6.4.299",
"hast-util-from-html": "^2.1.0",
"pdfjs-dist": "^6.5.438",
"saxes": "^6.0.0",
"unist-util-visit": "^5.1.0"
"unist-util-visit": "^5.2.0"
},
"devDependencies": {
"@types/node": "^26.6.5",
"@types/node": "^26.6.6",
"typescript": "^7.0.2",
"vitest": "^5.0.3"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/migrate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@unbent/enex": "workspace:*"
},
"devDependencies": {
"@types/node": "^26.6.5",
"@types/node": "^26.6.6",
"tsx": "^4.23.15",
"typescript": "^7.0.2",
"vitest": "^5.0.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.2",
"unified": "^11.0.5",
"unist-util-visit": "^5.1.0",
"unist-util-visit": "^5.2.0",
"yaml": "^2.9.1",
"zod": "^4.6.7"
},
Expand Down
Loading
Loading