'read-while-queued' ​Contract 2.0.0 · package sha256
a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e· generated fromconfigurator-runtime.d.ts,tables/problems.jsonandservices/onsite-scripter/scripts/contract-docs-what-to-do.jsonbyservices/onsite-scripter/scripts/build-contract-docs.mjs; edit the source, not this file.
A member of ProblemCode · stable · since 2.0.0
Strict fake only: code read a target that still had a write queued behind a transaction.
Don't read a target back with session.state() while its write is queued behind a transaction: show the value you wrote, then correct it from the write's Report once it settles. Inside a transaction's work, read through tx (tx.getSceneModel(), tx.state()), never session: a tx read sees the transaction's staged writes and records nothing.
label.text = name;
const r = await session.select(group, material);
if (r.outcome !== 'committed') label.text = previous;
Session.transaction: A session read of a target that has a write queued behind the transaction, in work or anywhere else on the page, is unspecified (the old or the queued value) until that write applies, and the strict fake records 'read-while-queued' for it (FakeSessionOptions.strict).testing.FakeSessionOptions.strict: Throws the runtime's errors and records every Problem, plus fake-only checks: a wrong-writer write after an await (tracked with AsyncLocalStorage) throws HoloScopeError; a session read of a target with a write queued behind an open transaction records 'read-while-queued', inside work too, while a read through that transaction's tx records nothing (read through tx inside work); a call…The set is open: handle a code you don't know ('other').
failure-matrix/cases/read-while-queued (tables/failure-matrix.json)