Six work items are successfully saved. The offline list shows four. Which two would you ask the operator to enter again? Until you have read the object store, that request could create a second copy of work the browser already holds. Until you have read the index, you also have no way to tell whether the screen found every item its query could have returned.
In the experiment below, six and four are the expected populations immediately after one completed batch. There is a third number worth writing down before debugging the screen. Only two of the six records have a status the application recognizes. An engineer who repairs just the two missing index entries can deliver a full list that still sends work to the wrong place.
You can investigate all three numbers in one tab with a fixed schema. Start with a literal manifest, save its six records, and read the stored values alongside the identities referenced by the status index. Then change one previously visible record through an ordinary edit. The decisive evidence is what happens to that same primary ID on both read paths. Use it to decide whether to publish the list, apply specific corrections authorized by the work-item owner, or leave the data intact while someone establishes what the status should be.
Define which saved work items the list must represent
The screen under review is the complete offline work list. Every retained work item belongs on it exactly once. Each item must also belong to exactly one of two groups. The literal string "ready" means the operator can take up the work. The literal string "hold" means the item stays visible while it waits. Putting work on hold changes its group. It never removes the work from this screen.
Write this contract down before looking at the data. In this review an IndexedDB record missing from the index is one whose primary ID occurs in the store audit and is absent from the unbounded index read. A screen deliberately limited to ready work has a different denominator. So does a screen showing only the first page of a long result. Here the denominator is every primary ID retained in the single object store. The unbounded index traversal is the list's read path. A later component might display the two approved groups, but its filtering cannot supply a record the index never referenced. It might also conceal an unexpected group that the unbounded traversal would reveal.
Give two people distinct review responsibilities. The list-query owner, usually the frontend engineer who maintains the repository method, identifies the store, index and query options used by the complete list. That engineer owns the coverage comparison and can withhold publication on a failed audit. The work-item owner, the person authorized to decide whether the work can proceed, approves the intended status for each correction. Knowing how to recover a saved title from IndexedDB confers no authority to release the work described by that title.
A sign-off therefore needs answers to three questions. Did the intended IDs reach storage? Does the list's index represent those IDs? Does each lookup value agree with the approved status for that item? Keep a place in the review for each answer. If a reviewer receives only a screenshot of a four-row list, the next evidence to request is a completed, store-level read with primary IDs. Guessing which rows are missing from their sort positions gives the record owner very little to act on.
Freeze six records and their expected identities
Give each item a stable string primary ID and a title that survives every status correction. The titles serve a practical purpose. A repair that reconstructs an object from only its ID and new status could fix the index and erase what the operator was supposed to do. Comparing complete values exposes that mistake. R2 will later receive a legitimate title edit to test whether the repair preserves newer, unrelated data.
The manifest plays two roles. It supplies the initial write values and preserves independent preimages for the experiment. Never replace a manifest element with a value returned by a browser request. After a bad replacement, the browser should report the bad current value. The reviewer still needs the earlier value to identify what changed. The separate ID lists below are literal expectations and remain the same even if the write helper or the index definition is edited by mistake.
Preserve the absent property in the literal fixture
Copy the JavaScript blocks in article order into a single file named fixture.js. They form one browser module. The shell block in the next section creates the page that loads it. The six objects below are the entire input population for each fresh case. The recorded run in the release section used this same module.
const manifest = [
{ id: "R1", title: "Inspect intake", status: "ready" },
{ id: "R2", title: "Check gasket", status: "hold" },
{ id: "R3", title: "Read gauge" },
{ id: "R4", title: "Inspect seal", status: null },
{ id: "R5", title: "Check relay", status: 7 },
{ id: "R6", title: "Read meter", status: "" }
];
const allIDs = ["R1", "R2", "R3", "R4", "R5", "R6"];
const seedIndex = ["R1", "R2", "R5", "R6"];
const seedValid = ["R1", "R2"];
function check(ok, message) {
if (!ok) throw new Error(message);
}
function same(actual, expected, message) {
check(JSON.stringify(actual) === JSON.stringify(expected), message);
}
function ids(actual, expected, message) {
same([...actual].sort(), [...expected].sort(), message);
}Read the third and fourth literals side by side. R3 has two fields. R4 has three fields, including an explicit JSON null. A spreadsheet cell left blank for both would discard evidence before the investigation began. The same care applies to R5 and R6. Quoting the number changes its type. Displaying the empty string as a dash makes it indistinguishable from an absent field in many review tables. Preserve the JSON values and give any human-readable rendition a separate column.
The comparison helper sorts copies of ID arrays. This is appropriate for the six fixed string IDs, and preserves the original traversal order for inspection. Unlike comparison through a deduplicated set alone, it also fails if the same ID appears twice on one side. Full-object comparisons here use JSON on plain fixture objects with predictable field order, finite numeric values and no undefined fields. That limited comparison is easy to inspect alongside these six literals.
Create a fixed-schema browser laboratory
Use an empty directory you control. If you have the companion fixture archive, extract it there. It includes the page, the complete module and the recorded JSON for comparison. Put fixture.js there and run the following shell commands from that directory. Open the local fixture page in one tab. Keeping the host literal consistent matters because origin includes the scheme, host and port. An audit at another origin would answer a question about different storage.
cat > index.html <<'HTML'
<!doctype html><meta charset="utf-8"><title>Work-item index audit</title>
<label>Browser and full build <input id="build"></label>
<label>OS and version <input id="os"></label>
<button>Run fixture</button><pre></pre>
<script type="module" src="./fixture.js"></script>
HTML
python3 -m http.server 8765 --bind 127.0.0.1Read the full browser build from the browser's version information and the OS release from the system's About information. Enter both in the page before pressing Run fixture. The page also captures the reported user agent, origin, start time, revision and database names. Keep the full build separately because a user-agent string can omit version detail. No remote dependencies, account, service worker or external application data are required.
const revision = "work-items/1.0";
const report = { revision, origin: location.origin, cases: [] };
function openFresh(name) {
return new Promise((resolve, reject) => {
const request = indexedDB.open(name, 1);
let created = false;
request.onupgradeneeded = event => {
if (event.oldVersion !== 0) return;
const store = request.result.createObjectStore("workItems", { keyPath: "id" });
store.createIndex("byStatus", "status", { unique: false, multiEntry: false });
created = true;
};
request.onerror = () => reject(request.error);
request.onsuccess = () => {
if (created) return resolve(request.result);
request.result.close();
reject(new Error("Fixture name already exists"));
};
});
}
function removeFixture(name) {
return new Promise((resolve, reject) => {
const request = indexedDB.deleteDatabase(name);
request.onsuccess = () => resolve();
request.onerror = () => reject(request.error);
});
}Each case gets its own disposable name. Version 1 contains the workItems object store with in-line primary key path id and the non-unique scalar index byStatus with key path status. The creation callback is needed to define those objects in a genuinely new database. Seeding starts only after the open request succeeds. If an existing database of that name opens, the helper closes the handle and rejects the run. The experiment neither seeds it nor schedules it for deletion.
Keep all six writes and all subsequent reads on this connection for the main case. The separate abort control runs later, in the same tab, with its own fresh copy of version 1. No other writer participates. The runner closes each handle and deletes exactly the name it created. Cleanup never requires clearing storage for the entire origin. Work involving an existing database version and another open connection belongs to the separate guide to coordinating an IndexedDB schema upgrade across tabs.
Wait for the completed batch before interpreting the list
The seed deliberately bypasses application admission. Its purpose is to find out which plain data objects ordinary put calls can retain and which secondary entries those calls create. All six records supply their own valid primary key. The success result of IDBObjectStore.put() identifies the primary key for that operation. A log line containing R4 is meaningful evidence that its put request succeeded, even though the status on R4 is null. The API permits a replacement under the same key on a later call.
Make the seed one readwrite transaction. Attach its terminal handlers first, then queue the six requests synchronously, in literal order. There is no need to await each one, and fetching input from another service between puts would introduce a different transaction-lifetime problem. A batch label on the trace associates each request with the operation that submitted it. On a clean seed, expect six successful request entries and one final complete entry.
Connect each request to the transaction that owns it
function completion(tx, log) {
return new Promise((resolve, reject) => {
tx.onerror = event => log.push(["error", event.target.error?.name]);
tx.oncomplete = () => { log.push(["complete"]); resolve(); };
tx.onabort = () => {
log.push(["abort", tx.error?.name ?? null]);
reject(tx.error ?? new DOMException("Explicit abort", "AbortError"));
};
});
}
async function write(db, label, rows, trace, abortFirst = false) {
const events = [];
trace.push({ label, events });
const tx = db.transaction("workItems", "readwrite");
const done = completion(tx, events);
const store = tx.objectStore("workItems");
try {
for (const row of rows) {
const request = store.put(row);
request.onerror = () => events.push(["put-error", row.id, request.error.name]);
request.onsuccess = () => {
events.push(["put", row.id, request.result]);
if (abortFirst && row === rows[0]) tx.abort();
};
}
} catch (error) {
tx.abort();
await done.catch(() => {});
throw error;
}
await done;
}The completion promise resolves only when the transaction sends its complete event. The error handler records the error and leaves its default handling intact. The abort handler records a separate terminal outcome, including the error name when the transaction supplies one. Deliberately calling abort() can leave the transaction's error value null. The wrapper still rejects in that case, so an explicit abort cannot silently follow the success path. The later rollback control exercises this distinction.
Stop after an unsuccessful seed. A partial list of request successes cannot be interpreted as the committed population. Even a completed batch answers only a transaction question. It does not test abrupt power loss, verify the business meaning of a status, or report how many entries a secondary index contains. Those last two facts require reading what the browser holds and comparing it with an independently stated rule.
Read the store and the index in one audit transaction
Open a fresh readonly transaction after the seed has completed. Ask it for three views while the transaction is active. The object store supplies full values. The index supplies primary IDs. A key cursor supplies the pairing between each lookup key and the item it references. A single transaction ties all three answers to one read of the database. Later, a different audit will describe the database after an edit.
async function audit(db, label, trace) {
const events = [];
const snapshot = { label, events, entries: [] };
trace.push(snapshot);
const tx = db.transaction("workItems", "readonly");
const done = completion(tx, events);
const store = tx.objectStore("workItems");
const index = store.index("byStatus");
const values = store.getAll();
const keys = index.getAllKeys();
const scan = index.openKeyCursor();
scan.onsuccess = () => {
const cursor = scan.result;
if (!cursor) return;
snapshot.entries.push({
key: cursor.key, type: typeof cursor.key, primaryKey: cursor.primaryKey
});
cursor.continue();
};
await done;
snapshot.rows = values.result;
snapshot.indexIDs = keys.result;
return snapshot;
}Calling IDBObjectStore.getAll() without arguments reads the entire population, including records with an absent status. Its return value is an asynchronous request. Reading values.result once the transaction has completed gives the fixture ordinary JavaScript objects to compare. The no-argument form also avoids an accidental lower bound, item limit or first-page default borrowed from a UI query.
The cursor opened by IDBIndex.openKeyCursor() advances inside its own success callback. Capture its key, JavaScript type and referenced primary key before calling continue(). The final callback receives no cursor, at which point this scan has no more entries. Avoid the direction that skips repeated index keys. Once repaired, three distinct items will share each approved status, and each reference belongs in the evidence.
When validating the index key path, preserve the path name alongside the raw key and primary ID. Here that path is always the case-sensitive string status. Leave raw evidence in retrieval order. Make sorted copies for comparisons or format a table after completion. This keeps display choices out of transaction callbacks and lets someone independently answer a simple question about R6. Did this run encounter an empty string key pointing to R6, or did a formatter insert a blank because the cursor never found R6? The raw entry answers directly. If any request errors and the read transaction aborts, retain the partial trace, withhold a coverage verdict and repeat the audit on a known state.
Reconcile the IDs that the index omitted
Start by comparing the store's IDs with the six literal IDs. Then compare the index's referenced IDs with that same population. Finally, join each cursor entry back to the stored record on its primary ID. The initial ledger below gives the expected result. A reviewer can point to the specific object behind every yes or no.
ID | Stored status representation | In store | In byStatus | Application-valid |
R1 | string "ready" | Yes | Yes | Yes |
R2 | string "hold" | Yes | Yes | Yes |
R3 | Property absent | Yes | No | No |
R4 | Explicit null | Yes | No | No |
R5 | number 7 | Yes | Yes | No |
R6 | string "" | Yes | Yes | No |
For R3, evaluating the secondary key path finds no property. For R4, evaluation finds a value, but null cannot become an IndexedDB key. In the W3C object-store storage algorithm, a failure, invalid result or exception during secondary key extraction skips that index entry. The valid primary IDs still identify stored records. This explains the missing entries without requiring any failure to write the objects. The rule concerns the secondary extraction step. An invalid primary key would raise a different question at write time.
Applying a status predicate only to rows already supplied by a query gives omitted IDs no opportunity to fail it. Here the independent population is six named stored items. For a separate JavaScript example of how traversal affects what a check establishes, see why a passing predicate can miss required input.
Distinguish the lookup key from the stored identity
Calling IDBIndex.getAllKeys() on byStatus returns the primary keys referenced by the index. Expect R1, R2, R5 and R6 when compared as identities. In forward cursor order, the expected pairs are 7 → R5, "" → R6, "hold" → R2 and "ready" → R1. Within an index key, entries are ordered by primary key. Comparing the index array position by position against the store's primary-key order would report differences even among correctly indexed records.
function verify(snapshot, expectedRows, expectedIndex, expectedValid) {
const { rows, indexIDs, entries } = snapshot;
ids(rows.map(row => row.id), allIDs, "Stored identities");
for (const expected of expectedRows) {
same(rows.find(row => row.id === expected.id), expected, "Stored " + expected.id);
}
ids(indexIDs, expectedIndex, "Indexed identities");
ids(entries.map(entry => entry.primaryKey), expectedIndex, "Cursor identities");
for (const entry of entries) {
const row = rows.find(item => item.id === entry.primaryKey);
check(entry.key === row.status && entry.type === typeof row.status,
"Cursor key for " + row.id);
}
ids(rows.filter(allowed).map(row => row.id), expectedValid, "Approved identities");
}The verifier deliberately accepts different expected populations at different stages. It can confirm that the failing fixture reproduced the predicted defect. Passing those initial assertions means the diagnosis is supported. Publication has its own stricter conditions, including agreement on all six IDs and the approved group for each one.
Check the values that entered the index
R5 is the work item most likely to mislead someone who checks only whether a lookup succeeded. A cursor can return a numeric key of 7 and the primary ID R5. The work item exists, the browser has a usable lookup value, and the reference points to the right object. Yet the application has no instruction for placing an item in group 7. Displaying that key in a status badge would expose a stored value without establishing its meaning.
R6 makes the converse mistake easy. A template that hides an empty label can leave the impression that there is no status entry at all. Inspect the raw pair. Its lookup key is a string of length zero and its primary ID is R6. IndexedDB accepts that string as a key. R3's absent property supplies no pair. The difference matters when someone proposes fixing the screen by displaying blank labels as “hold.” That display change cannot recover R3 and would silently make a business decision about R6.
function allowed(row) {
return row.status === "ready" || row.status === "hold";
}Evaluate this predicate over the full rows array returned by the store. The expected failing IDs are R3, R4, R5 and R6. Of those, R3 and R4 need an index entry as well as an approved value. R5 and R6 already have an entry whose key needs to change. A truthiness test would admit the number 7. A string-type test would admit the empty string. Strict comparison with the two approved literals rejects both and keeps the vocabulary small enough for the work-item owner to review.
The type boundary follows from the IndexedDB specification's definition of keys. The two-value vocabulary is an application decision and can change independently of the browser specification. When documenting a defect, record both the observed type and the policy in force at the time. A separate example of the questions an index definition actually answers appears in the scope of MongoDB multikey uniqueness. The present test needs only one scalar value per item.
Reproduce index drift after a successful update
Now test an edit to an item the initial index could find. Use the same ID and title as R1 and replace its status with explicit null. The replacement goes through a new ordinary readwrite transaction. The expected request result is still "R1". Once that transaction completes, open a new audit. Reusing the first audit's in-memory arrays would answer the earlier question correctly while making this regression invisible.
async function mainCase(db, trace) {
await write(db, "seed", manifest, trace);
const before = await audit(db, "initial", trace);
verify(before, manifest, seedIndex, seedValid);
const replacement = { ...manifest[0], status: null };
await write(db, "replace R1", [replacement], trace);
const drift = await audit(db, "after replacement", trace);
const changed = [replacement, ...manifest.slice(1)];
verify(drift, changed, ["R2", "R5", "R6"], ["R2"]);
await review(db, trace, drift, changed);
}The important property of put here is replacement. A caller that supplies an object under an existing primary key writes that object's data. IndexedDB maintains the associated index references for the replacement. The old ready reference for R1 is removed, and the new null status yields no index entry. An application that once cached R1 in a ready group could temporarily show the previous state. This experiment reads the database again so the classification rests on the current stored value.
Trace the one-record change without losing its preimage
Evidence for R1 | After seed | After replacement |
Stored primary ID | R1 | R1 |
Stored title | Inspect intake | Inspect intake |
Stored status | "ready" | null |
Index reference | "ready" → R1 | None |
Meets status policy | Yes | No |
Keep R2 through R6 as controls for this step. Their complete stored records should compare equal to the literals. R2, R5 and R6 should still appear in the index with their original typed keys. R3 and R4 should still be absent from it. The expected result is six stored, three indexed, one approved. A change to any control warrants an investigation of the writer or the case setup before attributing the disappearance to the R1 replacement.
The preimage gives the reviewer grounds to say precisely when R1 ceased to appear. It also gives the owner a candidate for correction. Those are different decisions. In an actual work queue, a transition away from ready could reflect an unresolved operational issue. An earlier valid value tells you what was recorded before the edit. The owner still has to decide whether restoring that value describes the work today.
Add a check at the application's write boundary
Place the rule at the boundary that receives the complete next record for persistence. That boundary can see the same representation that will reach the store. A disabled form option checks only one interface. A “save changes” function that validates the old stored object can approve a candidate whose replacement status is null. Validate the object after assembling the edit and before opening its write transaction.
async function admit(db, label, candidates, trace) {
const rejected = candidates.filter(row => !allowed(row));
if (rejected.length) {
trace.push({ label, decision: "REJECT_BEFORE_WRITE", rejected });
return false;
}
await write(db, label, candidates, trace);
return true;
}The same entry point can admit a new record or replace an existing one. This experiment fixes the primary IDs in the manifest and adds no seventh item. For a positive edit, change R2's title to "Check gasket twice" while preserving "hold". The admitted write should produce a successful R2 request and a completed transaction. Read back the new title. It gives you evidence that the valid path can make a real change through the same boundary.
For the negative edit, resubmit the edited R2 with status: null. Expect a rejection that records the entire proposed object before any write begins. A fresh audit must still find the new title, status hold and the reference from hold to R2. A rejected proposal can be valuable evidence even though it has no corresponding transaction. Label it separately so that a subsequent operator cannot mistake seeing a null candidate in the trace for finding null in the database.
Inspect the application's actual entry points when adopting this rule. A quick-edit button, an offline import and a bulk status action may all call the same persistence method, or one may call the object store directly. For each path, trace the object from construction to the eventual put. Route ordinary writers through the shared check. Keep the deliberately unguarded writer in this disposable test so the original failure can be reproduced. A boundary check protects later writes that pass through it. The four original invalid rows and the later R1 regression still need a separate decision.
Prepare a correction that the record owner can approve
Use the latest completed store audit as the repair input. By now R1 has null status and R2 has its edited title. Keep those preimages alongside the initial seed. The seed explains how the case began. The latest audit explains exactly which values a correction would replace. Preparing updates from the older seed would risk discarding valid edits that occurred between the original write and the review.
ID | Current stored status | Authorized result | Basis in this exercise |
R1 | null after replacement | "ready" | Owner approves restoring the earlier group |
R2 | "hold" | "hold" | Already valid, exclude from correction writes |
R3 | Absent | "ready" | Owner assigns a group |
R4 | null | "hold" | Owner confirms the item must wait |
R5 | 7 | "hold" | Owner supplies its meaning for this ID |
R6 | "" | "ready" | Owner explicitly releases this item |
const approved = new Map([
["R1", "ready"], ["R3", "ready"], ["R4", "hold"],
["R5", "hold"], ["R6", "ready"]
]);
function prepare(rows, mapping) {
const updates = [], unresolved = [];
for (const row of rows.filter(item => !allowed(item))) {
const next = { ...row, status: mapping.get(row.id) };
if (mapping.has(row.id) && allowed(next)) updates.push(next);
else unresolved.push(row.id);
}
return { updates, unresolved };
}The mapping is authored policy for these named records. Nothing about number 7 inherently means hold. The two null records even receive different corrections. For real work, give the owner the stable ID, description, actual raw value and any prior authorized state. Ask for the intended group and the evidence behind it, such as the work instruction or the disposition of a dependency. Record who approved the decision and which preimage they reviewed. An attractive chart of six green checks has no bearing on whether an item may proceed.
Make ambiguity stop the repair
Remove only the R4 mapping in a copy of the approved map. The preparation step should identify R4 as unresolved and produce four other proposed updates. Hold the whole plan. The control performs no puts, retains R4 with explicit null and repeats the audit so that the state of all six records is available afterward. A partial proposal can be reviewed without becoming an accidental partial release.
Return a specific question to the owner. “May R4, Inspect seal, proceed, or must it wait?” gives them a decision they can answer. “What should we do with missing index entries?” mixes the technical symptom with business authority. Preserve null until the answer is known. In the complete fixture plan the owner has supplied hold, and only that separately approved version enters the write path.
Apply the approved map and qualify the fresh result
The review function below runs the valid and rejected edits, the incomplete-map control and the approved correction in order. It constructs five replacements from the latest stored objects, changing only status. A check on the update IDs keeps R2 out of the batch. The same admission function checks all five candidates before any writes begin. The qualification step uses independently declared ready and hold groups to catch a swapped assignment even if every resulting value belongs to the vocabulary.
async function review(db, trace, drift, changed) {
const edited = { ...manifest[1], title: "Check gasket twice" };
const rejected = { ...edited, status: null };
check(await admit(db, "valid edit", [edited], trace), "Valid edit refused");
check(!await admit(db, "null edit", [rejected], trace), "Null edit admitted");
const pre = await audit(db, "repair preimages", trace);
const preRows = changed.map(row => row.id === "R2" ? edited : row);
verify(pre, preRows, drift.indexIDs, ["R2"]);
const partial = new Map(approved);
partial.delete("R4");
const incomplete = prepare(pre.rows, partial);
ids(incomplete.unresolved, ["R4"], "Ambiguity control");
trace.push({ decision: "HOLD", unresolved: incomplete.unresolved });
const held = await audit(db, "after incomplete plan", trace);
verify(held, preRows, drift.indexIDs, ["R2"]);
const plan = prepare(pre.rows, approved);
trace.push({ mapping: [...approved], plan });
ids(plan.unresolved, [], "Unresolved correction");
ids(plan.updates.map(row => row.id), [...approved.keys()], "Correction identities");
check(await admit(db, "reviewed correction", plan.updates, trace), "Plan rejected");
const ready = ["R1", "R3", "R6"], hold = ["R2", "R4", "R5"];
const expected = preRows.map(row => ({
...row, status: ready.includes(row.id) ? "ready" : "hold"
}));
function qualify(snapshot) {
verify(snapshot, expected, allIDs, allIDs);
for (const [status, group] of [["ready", ready], ["hold", hold]]) {
ids(snapshot.entries.filter(e => e.key === status).map(e => e.primaryKey),
group, "Index group " + status);
}
}
qualify(await audit(db, "after correction", trace));
check(!await admit(db, "retry null edit", [rejected], trace), "Retry admitted");
qualify(await audit(db, "after rejected retry", trace));
}Inspect the completed correction as a consumer would. The fresh store read must return all six identities and their expected full objects, including R2's revised title. The unbounded index must reference those six identities exactly once. Finally, the typed cursor values must assign R1, R3 and R6 to ready, and R2, R4 and R5 to hold. The two groups have the same size. Swapping R3 and R4 would preserve both group counts, and only an identity-level comparison would expose the error.
Retry the exact rejected R2 candidate against the repaired database. Its rejection should again occur before a transaction starts. A second qualification must recover the complete repaired state. These two checks distinguish a successful one-time correction from a writer that can immediately recreate the defect. Keep both readbacks, even though their contents should agree. One follows the approved changes and the other follows an attempted invalid write.
For publication, pass the verified result for this run to the list owner. If a screen shows a different population, capture which query and result the component actually rendered. An older asynchronous response could overwrite a newer valid result in memory. That issue needs separate UI evidence, as described in guarding UI updates against stale responses. Running more status corrections against correctly repaired records would put the wrong component under review.
Exercise an aborted correction and recover the review
Start this control with a second fresh copy of the six-record seed. It has its own database name, the same schema version and the original titles. Verify its baseline before the attempted correction. In particular, R1 should be ready and indexed here. Importing the main case's post-drift expectation would make a correct rollback look like a data change.
async function abortCase(db, trace) {
await write(db, "control seed", manifest, trace);
verify(await audit(db, "control baseline", trace), manifest, seedIndex, seedValid);
const candidate = { ...manifest[2], status: approved.get("R3") };
try {
await write(db, "abort R3 correction", [candidate], trace, true);
throw new Error("Correction unexpectedly completed");
} catch (error) {
if (error.name !== "AbortError") throw error;
}
const attempt = trace[trace.length - 1];
same(attempt.events.map(event => event[0]), ["put", "abort"], "Abort evidence");
verify(await audit(db, "after abort", trace), manifest, seedIndex, seedValid);
}The candidate gives R3 its authorized ready status and keeps the rest of the object intact. Its put success handler requests an abort while the write transaction is still active. The trace must show the R3 request followed by the terminal abort. If the write completes, the control fails even if a later read looks plausible. Once the abort is recorded, a new read must recover the original full objects, four referenced IDs and original cursor pairs. R3 must again have no status property and no index reference.
Reconstruct the audit from the object store
An operator with a specific ID can queue store.get("R3") in a fresh readonly transaction and inspect its result after completion. This uses the store's primary key and can locate the hidden object directly. If the missing identities are unknown, start with the complete store audit. Enumerating additional status ranges cannot reveal an object for which no secondary entry exists.
For an already committed correction that must be reversed, use the preimages from immediately before that correction. Check that each current object still matches the reviewed post-correction state before applying a reversal. Restoring a missing property requires a replacement object that omits it. Assigning null to that field would create a different stored object, even if both versions disappeared from the index. A deliberate reversal to an invalid historical state needs owner authorization, a controlled write and a new publication hold. An aborted transaction needs no compensating write.
If the preimage is unavailable, recover the actual earlier object, including the distinction between absent, null and empty string. If the status decision is missing, recover the owner's per-ID authorization. A successful primary-key lookup can establish what is present now. It cannot reconstruct a missing instruction or approval. Keep the case on hold until the missing evidence is identified and recovered.
This final block runs the two cases sequentially. Copy the page's JSON output before reloading or closing it. The output retains its raw records, index references, request outcomes and terminal events after the named disposable databases have been removed.
async function run() {
check(location.origin === "http://127.0.0.1:8765", "Use the fixture origin");
report.browserBuild = document.querySelector("#build").value.trim();
report.os = document.querySelector("#os").value.trim();
check(report.browserBuild && report.os, "Enter the browser build and OS");
report.userAgent = navigator.userAgent;
report.started = new Date().toISOString();
for (const [role, exercise] of [["main", mainCase], ["abort", abortCase]]) {
const name = "refonte-work-items-" + role + "-" + crypto.randomUUID();
const trace = [];
report.cases.push({ role, name, trace });
const db = await openFresh(name);
try {
await exercise(db, trace);
} finally {
db.close();
await removeFixture(name);
}
}
report.verdict = "PUBLISH_REVIEWED_FIXTURE";
}
document.querySelector("button").onclick = async event => {
event.currentTarget.disabled = true;
try {
await run();
} catch (error) {
report.verdict = "HOLD";
report.failure = String(error);
} finally {
document.querySelector("pre").textContent = JSON.stringify(report, null, 2);
}
};Decide whether the index-backed list can be released
Use the verdict that describes the evidence in hand. A matching index population answers the coverage question. A matching approved group for every retained ID answers the routing question. If either answer is unavailable, hold publication of the complete list and give the outstanding decision to the person who can resolve it.
Evidence in this run | Action | Accountable owner |
All six stored and indexed once, approved typed groups exact, unrelated data preserved, invalid retry rejected | Publish the reviewed list for this fixture revision | List-query owner |
Store contains IDs with no index entry | Hold the list, identify each missing reference, submit per-ID corrections for approval | List-query owner identifies IDs, work-item owner authorizes |
IDs indexed under unacceptable statuses | Hold the list, retain raw lookup keys and request the intended groups | Work-item owner |
Incomplete read, failed assertion or unexpected transaction abort | Preserve the trace, recover a known baseline and repeat the affected case | Frontend storage maintainer |
A proposed correction lacks a business decision | Preserve the current objects, record unresolved IDs and wait for authorization | Work-item owner |
Observed run, 5 December 2026. WebKitGTK MiniBrowser 2.54.3 executed revision work-items/1.0 on Debian GNU/Linux 13.7 (trixie), x86_64, on the same HTTP loopback origin (127.0.0.1, port 8765). The seed recorded six successful puts and a transaction completion. The following are actual readbacks from this run. Within each row the index IDs appear in retrieval order.
Completed read | Stored IDs | Index primary IDs | Decision supported |
Main seed | R1–R6 | R5, R6, R2, R1 | Hold the list |
After replacing R1 | R1–R6 | R5, R6, R2 | R1 retained, index entry gone |
After incomplete proposal | R1–R6 | R5, R6, R2 | R4 unresolved, no writes |
After approved correction and again after rejected retry | R1–R6 | R2, R4, R5, R1, R3, R6 | Publish reviewed groups |
Fresh control after R3 put success and transaction abort | R1–R6 | R5, R6, R2, R1 | Original baseline recovered |
All assertions passed. The run recorded PUBLISH_REVIEWED_FIXTURE for the repaired main case. The abort case passed its rollback check with the original invalid records still present. The observed behavior agreed with the expected storage and key-extraction rules in this build.
Retain the literal manifest, revision, environment, raw JSON output and approved mapping together. Keep the case name on every excerpt from the abort control. For a divergence, identify the first differing primary ID, its full stored value, the actual cursor pair if present and the terminal transaction event. Compare that observation with the W3C storage rule before changing the fixture. Preserve the original observation even if a later run agrees with the prediction.
Repeat the check when a writer starts replacing whole objects, a new edit path bypasses admission, the allowed vocabulary changes, or the screen changes its index, range or limit. A change to the supported browser build is also a reason to rerun before carrying forward a release record. This small audit establishes membership for one tab with one writer and a fixed schema. It does not exercise upgrades, blocked tabs, unique constraints, compound or array keys, multiEntry, concurrent writers, quota failures, eviction or server synchronization. For a distinct coordination problem, see synchronizing session changes between browser tabs.
Practice reviewing browser data contracts
A useful frontend project review can start with one work item. Ask the person presenting the feature to follow R3 from its literal object to a successful request, a completed batch and a blank spot in the index ledger. Then ask them to recover the title without using the list. That short demonstration tests whether they know which API can answer a question about retained data and which API describes what the screen can find.
Give another reviewer R5. Their job is to explain why a successful index lookup leaves a decision for the work-item owner. Together, the reviewers can sign off on a specific result. The repaired list contains six known IDs, each appears under its authorized status, and a rejected replacement leaves the committed values intact. If an owner cannot decide one of those statuses, naming the unresolved item is a more accurate deliverable than publishing a complete-looking list.
For project work that builds on this kind of JavaScript and application-state review, consider Refonte Learning's FrontEnd Developer Program. Its curriculum includes JavaScript ES6+ and practical projects. For the next project review, keep the input, inspect the saved result and show which identities the interface actually presents.
