Commit f1ba99c
fix: Log Finalize Awaits Terminal Stream State (#177)
* fix: Log Finalize Awaits Terminal Stream State
LogWriteStreamRegistry.finalize decided success/failure by reading
entry.error at whatever moment its finally completed, instead of after
the stream's terminal close state. That produced two wrong outcomes: a
fully-flushed log with a stale non-destroying recorded error rejected
(contradicting the file's own contract), and a close-time error
arriving after the check silently missed. finalize now awaits the
stream's terminal 'close' state before deciding, and the success
predicate is state-based: resolve iff writableFinished &&
stream.errored === null (warn-and-resolve over a stale recorded
error), else reject with entry.error ?? stream.errored.
Supersedes the PR #173 decision to document rather than fix the
unconditional recorded-error rejection, reopened on two independent
reviewers converging (operator-side should-fix; CodeRabbit MAJOR /
data integrity).
* Update ship status and record PR URL
* fix: address review feedback from @coderabbitai[bot]
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Update review-pr status
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: droid-ash <droid-ash@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent bc6e634 commit f1ba99c
8 files changed
Lines changed: 754 additions & 142 deletions
File tree
- docs/memory/device-node
- fab/changes/260731-vojm-log-finalize-terminal-state
- packages/device-node/src/device
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
Large diffs are not rendered by default.
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
0 commit comments