Skip to content

Commit 7a27f38

Browse files
authored
Merge pull request #50 from SQLoot/sync/common-v8-2026-02-25
Sync PR: upstream/common-v8 & fixes 25-02-2026
2 parents 2fc08f5 + e34ce6e commit 7a27f38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2715
-1191
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# TODO and Skipped Tests Audit (2026-02-25)
2+
3+
## Current totals
4+
5+
- `TODO` in `packages/*`: `43` (down from `56`)
6+
- `FIXME` in `packages/*`: `0`
7+
- skipped tests (`test.skip`, `it.skip`, `describe.skip`, `test.todo`, `it.todo`): `5` (down from `9`)
8+
9+
## What changed in this pass
10+
11+
- Unskipped and stabilized:
12+
- `packages/common/test/Crypto.test.ts`
13+
- `packages/common/test/Identicon.test.ts`
14+
- Cleaned low-risk TODO stubs:
15+
- `packages/react-native/src/exports/bare-op-sqlite.ts`
16+
- `packages/web/src/WebWorker.ts` (commented skeleton)
17+
- Removed storedBytes placeholders and added cumulative accounting:
18+
- `packages/common/src/local-first/Sync.ts`
19+
- `packages/common/src/local-first/Db.ts`
20+
- shared helper: `packages/common/src/local-first/Storage.ts`
21+
- Added client-side quota checks in Sync receive path:
22+
- `packages/common/src/local-first/Sync.ts`
23+
- Replaced global Sync mutex with per-owner mutexes:
24+
- `packages/common/src/local-first/Sync.ts`
25+
- Removed stale heartbeat TODOs already covered by implemented failover logic:
26+
- `packages/common/src/local-first/Db.ts`
27+
- `packages/common/src/local-first/Shared.ts`
28+
- Removed unused `Db` client-storage stub (including obsolete collaborative quota TODO):
29+
- `packages/common/src/local-first/Db.ts`
30+
- Removed stale Sync TODO stubs/comments and added baseline Sync tests:
31+
- `packages/common/src/local-first/Sync.ts`
32+
- `packages/common/test/local-first/Sync.test.ts`
33+
- Replaced transport `todo()` stub with task bridge and added transport lifecycle tests:
34+
- `packages/common/src/local-first/Sync.ts`
35+
- `packages/common/test/local-first/Sync.test.ts`
36+
- Removed stale/invalid TODO text from `Evolu` API docs:
37+
- `packages/common/src/local-first/Evolu.ts`
38+
39+
## Remaining skipped tests (intentional)
40+
41+
1. `packages/common/test/Result.test.ts:321`
42+
2. `packages/common/test/Result.test.ts:1210`
43+
- Performance-only comparisons, not correctness tests.
44+
45+
3. `packages/common/test/local-first/Storage.test.ts:425`
46+
4. `packages/common/test/local-first/Storage.test.ts:456`
47+
- Long-running stress tests (`1_000_000` scale / large collision experiment).
48+
49+
5. `packages/common/test/Sqlite.test.ts:615`
50+
- Performance benchmark (commented out), not correctness regression.
51+
52+
## High-value TODO clusters for issue extraction
53+
54+
### A) Sync transport inbound protocol handling
55+
56+
- `packages/common/src/local-first/Sync.ts:282`
57+
- `onMessage` currently logs and returns; protocol message application is still disabled.
58+
- Transport lifecycle is now wired, but inbound relay sync processing is not yet active in this path.
59+
60+
Recommended scope: **M** _(Medium — roughly 1–3 days of focused implementation work)_
61+
62+
## Suggested execution order
63+
64+
1. Sync transport inbound protocol handling (A).

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
pull_request:
5-
branches: ["**"]
5+
types: [opened, synchronize, reopened, ready_for_review]
66
push:
77
branches: ["main"]
88
merge_group:
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Tree-Shaking Compat
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "20 3 * * *"
7+
push:
8+
branches: ["main"]
9+
paths:
10+
- "packages/common/test/TreeShaking.test.ts"
11+
- "packages/common/src/**"
12+
- "package.json"
13+
- "bun.lock"
14+
- ".github/workflows/tree-shaking-compat.yaml"
15+
16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: tree-shaking-compat-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
tree-shaking-compat:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
31+
with:
32+
node-version: 24
33+
34+
- name: Setup Bun
35+
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
36+
with:
37+
bun-version: "1.3.9"
38+
39+
- name: Install dependencies
40+
run: bun install
41+
42+
- name: Build @evolu/common
43+
run: bunx turbo --filter @evolu/common build
44+
45+
- name: Run tree-shaking compatibility lane
46+
run: bun run test:tree-shaking:compat

apps/relay/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"dev": "bun src/index.ts",
7+
"dev": "bun --watch src/index.ts",
88
"build": "rimraf dist && tsc",
99
"start": "node dist/src/index.js",
1010
"clean": "rimraf .turbo node_modules dist data/evolu-relay.db"

apps/relay/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { mkdirSync } from "node:fs";
22
import { createConsole, createConsoleFormatter } from "@evolu/common";
33
import { createRelayDeps, createRunner, startRelay } from "@evolu/nodejs";
4+
import { startBunRelay } from "./startBunRelay.js";
45

56
// Ensure the database is created in a predictable location for Docker.
67
mkdirSync("data", { recursive: true });
@@ -18,8 +19,11 @@ const deps = { ...createRelayDeps(), console };
1819
await using run = createRunner(deps);
1920
await using stack = run.stack();
2021

22+
const isBunRuntime = (globalThis as { readonly Bun?: unknown }).Bun != null;
23+
const startRelayTask = isBunRuntime ? startBunRelay : startRelay;
24+
2125
await stack.use(
22-
startRelay({
26+
startRelayTask({
2327
port: 4000,
2428

2529
// Note: Relay requires URL in format ws://host:port/<ownerId>

0 commit comments

Comments
 (0)