Skip to content

test(blob): correct complete() fault contract for track-only vs needs-saving blobs (#1353/#1376) - #1390

Merged
kriszyp merged 1 commit into
mainfrom
kris/fix-blob-savefault-abort
Jun 19, 2026
Merged

test(blob): correct complete() fault contract for track-only vs needs-saving blobs (#1353/#1376)#1390
kriszyp merged 1 commit into
mainfrom
kris/fix-blob-savefault-abort

Conversation

@kriszyp

@kriszyp kriszyp commented Jun 19, 2026

Copy link
Copy Markdown
Member

Summary

Fixes the RED unit test on main in unitTests/resources/blob.test.js: the case asserting startPreCommitBlobsForRecord().complete() "tolerates a source-missing blob but still rejects a transient fault." This is a stale test assertion, not a code regression — resources/blob.ts is unchanged.

Why it was red

The old test drove the transient-fault blob through the track-only path, which complete() no longer awaits, so the expected rejection never fired → Missing expected rejection.

What changed (test-only)

Impact

  • Not a v5.1.5 data-loss regression; no 5.1.6 code patch is needed.
  • Merging turns main's unit suite green again — it's currently blocking clean unit signal on every PR, so it should land promptly.

Where to look

unitTests/resources/blob.test.js — the single rewritten it(...) block. No production code touched.

Verification

  • blob.test.js: 28 pass / 1 fail → 29 pass / 0 fail (stable across repeated runs).
  • test:unit:resources: 841 passing, 14 pending, 0 failing.
  • test:unit:main: 2755 passing, 188 pending, 0 failing.
  • Codex cross-model review: no regression found.

Generated by Claude (Opus 4.8).

…-saving blobs (#1353/#1376)

The blob unit test asserting complete() "tolerates a source-missing blob
but still rejects a transient fault" was RED on main. The assertion was a
stale leftover from #1353, not a code regression.

#1353 made complete() await EVERY pre-commit blob, so any save fault aborted
the commit. #1376 then split pre-commit blobs into blobsNeedingSaving
(saveInRecord / saveBeforeCommit — still awaited) and blobsToTrackOnly
(already-saving, replication-received — deliberately NOT awaited, to avoid a
WS deadlock when a back-pressured copy stream can't supply more chunks:
harper-pro#414). Track-only durability moved off commit-abort onto the
replication resume cursor (hasBlobGap pins lastDurableSequenceId so the blob
is re-streamed on reconnect).

The old test drove the transient-fault blob through the track-only path,
which complete() no longer awaits, so the expected rejection never fired.

This is a test-only contract correction (resources/blob.ts is unchanged):
- the "transient fault must still abort" assertion now targets a
  needs-saving (saveBeforeCommit) blob, where abort is still the contract;
- a new case asserts a transient fault on a track-only blob does NOT abort;
- the source-unavailable→tolerated case is kept (now on the awaited
  needs-saving path, so it genuinely exercises the isSourceBlobUnavailable
  tolerance in complete());
- a comment records the #1353#1376 history so it isn't "fixed" back.

Not a v5.1.5 data-loss regression and no 5.1.6 code patch is needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@kriszyp
kriszyp requested review from Ethan-Arrowood, cb1kenobi and kylebernhardy and removed request for cb1kenobi June 19, 2026 05:25
@claude

claude Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Reviewed; no blockers found.

@kriszyp
kriszyp marked this pull request as ready for review June 19, 2026 11:52
@kriszyp
kriszyp merged commit 6601cf1 into main Jun 19, 2026
47 of 48 checks passed
@kriszyp
kriszyp deleted the kris/fix-blob-savefault-abort branch June 19, 2026 11:53
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.

1 participant