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
{{ message }}
Repository navigation
A first source fill raced by a write resolves the caller with its own @createdTime while the row keeps the raced one #3567
A first source fill (getFromSource, no stored entry when it started) that replaces a record which landed while the source call was in flight keeps that record's @createdTime in the stored row and its index, as a put would. The fill stamps @createdTime before it resolves the caller, though, so the caller's record and the @embed/@decide hooks carry the fill's own created time, not the stored one.
Why it is not fixed yet
The caller is resolved before the commit runs, and the commit is the first point that sees the raced record. Re-reading the entry under the fill lock narrows the window but cannot close it: the fill lock does not exclude puts.
Re-running the model hooks when the commit finds a different created time would need a retry loop around a synchronous commit callback, for a guarantee no write path gives today (_writeUpdate runs its hooks before the commit stamps timestamps).
Documented as a known limit in resources/DESIGN.md ("getFromSource() timing"). Pinned behavior for the stored row: unitTests/resources/caching.test.js "first source fill replaces an older raced record".
A related, smaller case: when the fill's commit is skipped (it lost the version race) or fails, the caller's record still carries the candidate @updatedTime/@createdTime stamps, which were never stored. The resolved entry's version already matched that candidate before this change.
Activity