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
[scanner] subscriber: tail mode drops an event whose line is partially written at start-up #365
The log is appended by pluk watch … >> logs/<session>.jsonl one console.log(JSON.stringify(event)) at a time (src/cli.ts:123, :189). If the subscriber's stat() lands while the writer's line is only partly on disk, position points into the middle of that record and partial starts empty. The first chunk the tail loop reads is the tail half of the record, which fails parseEvent and is discarded — the event is lost, and nothing is logged even with --verbose.
seedResumeMarker() already reads the last chunk before position to seed lastLine, so the bytes needed to detect this are already in hand.
Expected
If the bytes before position do not end in \n, start the tail at the beginning of that unterminated final line (or seed partial with it) so the record is delivered once the writer finishes it.
Suggested fix
In start() (tail mode, position > 0): reuse the chunk read in seedResumeMarker — if it does not end with \n, move position back to the start of the trailing partial line (or set partial to it). Add a regression test in test/ that writes a half line, starts the subscriber, appends the rest plus \n, and asserts the event is emitted.
Severity: low (start-up race; one event lost per occurrence, no error surfaced).
🔒 Claimed by @mendezr (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.
Activity
hivecommons-hive commentedon Oct 24, 2026
🔒 Claimed by @mendezr (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply
/unclaimto release, or/claimto take it over if you outrank the holder.hivecommons-hive commentedon Oct 24, 2026
🔓 Claim by @mendezr released (lease revoked).
fix(subscriber): preserve unfinished events at tail startup (#366)