Repository navigation
Reads through a base type spell dates the same on a cold client; a live suite compares every read cold and warm - #74
Merged
Conversation
…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
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,sendandsendGuardedwith 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.listandattachments.pagewith a select. It is read-only.One of them differed.
What else was wrong
client.deletedthrough a base type. A read ofPrimaryWorkitemanswers 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 answered2011-09-14T00:00:00.000.client.historyof 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
searchalready loaded each concrete type it searches.resolve,batchname lookups, guard's stamp reads, andattachmentswithout a select read the wire shape with no schema, so they cannot differ between cold and warm.listsloads the list type before translating.Also here
deletedcase on a cold client; it fails without the fix.Generated by Claude Code