Skip to content

Reads through a base type spell dates the same on a cold client; a live suite compares every read cold and warm - #74

Merged
jallers merged 1 commit into
masterfrom
claude/cold-client-sweep
Nov 27, 2026
Merged

jallers merged 1 commit into
masterfrom
claude/cold-client-sweep

Conversation

@jallers

@jallers jallers commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #73. That fault (a read that never loaded the types its answer is translated by) is a class, so every read that translates rows was checked for it.

The sweep

A new live suite, test/integration/coldClient.test.ts, runs each read twice, on a client made for the call and on one seeded with the whole metamodel, and requires equal answers. 23 reads: query, queries, get, queryPage, all, send and sendGuarded with a query in the batch, search (several types, an abstract type), deleted, history (of a type, an asset, a base type's asset), template, fields.describe, lists.values (new asset, existing asset), lists.value, resolve.refs, attachments.list and attachments.page with a select. It is read-only.

One of them differed.

What else was wrong

client.deleted through a base type. A read of PrimaryWorkitem answers Story and Defect rows, and a rest-1 row's dates are spelled by the row's own type. The client loaded only the type asked for, so on a cold client a date rest-1 writes as the day alone (2011-09-14, a midnight) stayed that way; once Story happened to be loaded, the same read answered 2011-09-14T00:00:00.000. client.history of a base type goes through the same code.

No caller can load those types ahead of the answer, so the fix is in the wire module: a rest-1 list or history read asks its lookup to load the types of the rows that came back (ensureFor, optional on the lookup; the client's schema has it) before spelling them.

Not affected

  • Reads through query.v1 and api/asset translate by the type asked for, which the client loads first.
  • search already loaded each concrete type it searches.
  • resolve, batch name lookups, guard's stamp reads, and attachments without a select read the wire shape with no schema, so they cannot differ between cold and warm.
  • lists loads the list type before translating.

Also here

  • Unit test for the deleted case on a cold client; it fails without the fix.
  • Changelog entry under Unreleased (to be 1.0.0-alpha.14).
  • AGENTS.md states the invariant and that a new read method is added to the suite's list.

Generated by Claude Code

…compares every read cold and warm

A deleted or history read through a base type answers rows of its
subtypes, whose dates are spelled by the row's own type. On a client
that had not loaded those types a midnight stayed in rest-1's spelling.
Found by running every translating read on a fresh client and on one
seeded with the whole metamodel, which is now a suite.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
@jallers
jallers merged commit edbe5ce into master Nov 27, 2026
4 checks passed
@jallers
jallers deleted the claude/cold-client-sweep branch November 27, 2026 05:09
@jallers jallers mentioned this pull request Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants