feat(e2e): enhance end-to-end testing configuration with matrix strategy and stdout handling4 days agod20de07
feat(realtime): collaborative editing with HLC, CRDT, presence, and hardened protocol
Adds a full realtime/multiplayer/collaboration stack across the rstore
packages, plus an audit pass that hardens the protocol against several
classes of silent failure.
Core (@rstore/core):
- HLC (Hybrid Logical Clock) with strict monotonicity, lexicographically
comparable string form, and a clock-skew defense that rejects remotes
whose physical exceeds local by more than maxClockSkewMs (default 5min)
or whose physical is non-finite. Rejection leaves clock state untouched
so retries with sane timestamps still work.
- CRDT field-level LWW merge and 3-way text merge. Concurrent inserts at
the same position are now handled before the order comparison and use
HLC ordering when timestamps are passed (with deterministic alphabetic
fallback) — the previous code returned -1 from compareTextChangeOrder
for same-position inserts, breaking commutativity across peers.
- Tombstone store with periodic auto-GC (scheduleTombstoneGc) and
shouldResurrect helper that respects per-field timestamps.
Nuxt-drizzle realtime:
- Protocol v2: HLC field timestamps on create/update, deletedAt on
delete frames, init handshake with version negotiation. Server rejects
clients beyond MAX_VERSION with an InitErrorMessage and closes; client
surfaces the rejection and stops reconnecting.
- Subscription auth via realtime.authorize hook (one-shot) and per-frame
realtime.filter hook (mutable session state).
- Single per-peer pubsub listener with microtask-batched flush.
- Subscription-key normalization at both publisher and server.
Nuxt-multiplayer client:
- useRstoreMultiplayerChannel for room-scoped pub/sub.
- useRstoreMultiplayerField with debounced focus-clear so rapid blur/
refocus does not flicker presence on remote peers.
- messageGuards for runtime validation of inbound frames.
Nuxt-multiplayer-server (new package):
- Room registry with peer membership, lazy creation, eviction on empty.
- Broadcast snapshots membership before iteration so peers joining
mid-broadcast (e.g. inside another peer's send handler) do not receive
in-flight messages.
- Per-peer send failure isolation, optional rate limiting, hookable
message routing.
Tests (rock-solid):
- 31 HLC tests including clock-backward monotonicity, NaN/Infinity
rejection, alternating receive/now sequences.
- 56 CRDT tests including commutativity without HLC, 3-peer pairwise
convergence, surrogate-pair (emoji) preservation, large input.
- 27 tombstone tests including late-delivery suppression, racing
resurrect, multi-peer concurrent delete with nodeId tiebreak.
- 23 realtime-ws tests including malformed frames, echo-suppression
edges, rejected-subscription state cleanup, throwing authorize hook,
duplicate-subscribe idempotence. Replaced 5 setTimeout(10) sleeps
with deterministic waitFor / expectNoMatch helpers — verified stable
across 10 consecutive runs.
- 15 room tests including mid-broadcast late joiners excluded, partial
send failures, exact peerId matching.
- 5 multiplayer-field tests under fake timers covering rapid blur/
refocus cancellation, multi-blur coalescing, separate-field
independence.
- E2E: structured JSON parsing in realtime-helpers (replaced brittle
substring matching), 15s expect.timeout default in playwright configs,
new collab-presence specs for rapid focus toggles and blur cleanup.4 days ago56c9615
feat: improve the skills pick up description2 weeks ago9a73eda