Skip to content

Flush the pause buffer when the adb stream ends - #68

Merged
laomou merged 1 commit into
mainfrom
fix/pause-buffer-eof-flush
Aug 7, 2026
Merged

Flush the pause buffer when the adb stream ends#68
laomou merged 1 commit into
mainfrom
fix/pause-buffer-eof-flush

Conversation

@laomou

@laomou laomou commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary (regression caught in self-review)

The pause buffer added in the "buffer logs while paused" change only flushed on the next non-paused line. If the adb stream ended while still paused — the device disconnects, or a finite logcat -d dump finishes mid-pause — the buffered lines were dropped with the reader thread instead of delivered (silent data loss).

Drain the buffer to the channel on EOF, before signaling ended.

Test plan

  • buffered_lines_flush_when_stream_ends_while_paused — pause before the child emits, child exits, all buffered lines are delivered (deterministic, 3× green)
  • Full suite + clippy clean

The pause buffer (lines held while paused) only flushed on the next non-paused
line. If the stream ended while still paused — device disconnects, or a finite
`logcat -d` dump finishes mid-pause — the buffered lines were dropped with the
reader thread instead of delivered. Drain the buffer to the channel on EOF.
@laomou
laomou merged commit baffee7 into main Aug 7, 2026
3 checks passed
@laomou
laomou deleted the fix/pause-buffer-eof-flush branch August 7, 2026 01:32
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