You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: uts/objects/PLAN.md
+66-60Lines changed: 66 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Context
4
4
5
-
The LiveObjects feature lets clients store shared CRDT data on realtime channels. The specification is at `specification/specifications/objects-features.md` — specifically the path-based API version on branch `origin/AIT-30/liveobjects-path-based-api-spec` (with batch API additions on `origin/AIT-30/liveobjects-batch-api`).
5
+
The LiveObjects feature lets clients store shared CRDT data on realtime channels. The specification is at `specification/specifications/objects-features.md` — the path-based API version squashed as commit `a397e34` ("LiveObjects path-based API spec").
6
6
7
7
An earlier attempt at UTS test specs exists in `uts/test/realtime/unit/objects/` (14 files). It was written against a different spec namespace (PO* vs RTPO*/RTINS*/RTLCV*/RTLMV*), used v5 wire format field names, had apply-on-ACK contradictions, and duplicated setup across files. We're doing a clean rewrite using the correct spec, informed by that earlier work.
8
8
@@ -12,7 +12,7 @@ All new test files go in `specification/uts/objects/`.
12
12
13
13
**Internal (not user-facing):** LiveObject, LiveCounter (CRDT counter), LiveMap (LWW map), ObjectsPool (sync state machine), RealtimeObject (channel orchestrator with publishAndApply)
| Wire format v6 everywhere | Spec branch uses v6 field names; old v5 names are "replaced by" stubs |
371
377
|`appliedOnAckSerials` on RealtimeObject (RTO7b), not on pool | Matches spec's placement; cleared at sync completion (RTO5c9) |
372
378
| No REST test files | objects-features.md has no REST API spec points; REST used only for integration fixture provisioning |
373
-
|`echoMessages` check retained on mutations|Spec retains RTLC12d, RTLM20d, RTLM21d|
374
-
| Batch uses RTO15 (publish), NOT RTO20 (publishAndApply) | RTBC16d says "publishes ... using `RealtimeObject#publish`" -- batch does NOT apply locally on ACK|
379
+
|`echoMessages` check moved to RTO26|RTO26c checks echoMessages=false; callers (PathObject/Instance) enforce via RTO26|
380
+
| Batch API deferred | Not included in current spec revision (a397e34); may be added in a future spec update|
375
381
| LiveObject/LiveMap/LiveCounter marked internal but still unit-tested | Direct testing of CRDT logic is essential; public API tests can't cover all edge cases |
376
382
| Test IDs use `objects/unit/` prefix | Matches directory structure, not nested under `realtime/`|
377
383
| Behavioral GC testing via ADVANCE_TIME | Verify GC through observable consequences (value becomes null, object recreatable) rather than internal pool state inspection |
Only entries whose value is a `LiveObject` (i.e. `data.objectId` is present) contribute to parentReferences. Primitive-valued entries ("name", "age", "active", "data", "avatar", "email", "theme") do not.
Wraps an existing `ObjectState` in an `ObjectMessage` with the `object` field populated. Used when `replaceData` (RTLC6, RTLM6) needs an `ObjectMessage` rather than a bare `ObjectState`.
236
+
237
+
```pseudo
238
+
build_object_message_with_state(objectState):
239
+
RETURN ObjectMessage(object: objectState)
240
+
```
241
+
242
+
### PublicAPI::ObjectMessage Builder
243
+
244
+
Constructs a `PublicAPI::ObjectMessage` from an internal `ObjectMessage` and a channel name, per PAOM3. Used by subscription tests that verify the user-facing message delivered to listeners.
pub.operation = PublicAPI::ObjectOperation from objectMessage.operation per PAOOP3
259
+
RETURN pub
260
+
```
261
+
219
262
---
220
263
221
264
## Standard Synced-Channel Setup
222
265
223
266
Used by all mock WebSocket test files. Creates a connected client with a synced channel containing the standard test pool.
224
267
268
+
After the OBJECT_SYNC sequence completes, the SDK rebuilds parentReferences per RTO5c10: reset all LiveObject parentReferences to empty (RTLO3f2), then iterate all LiveMap entries calling addParentReference (RTLO4g) for each entry whose value is a LiveObject. See "Expected parentReferences after sync" above for the resulting state.
0 commit comments