Skip to content

Commit

Permalink
device-logs: Fix streaming suppressed logs warnings out of order
Browse files Browse the repository at this point in the history
  • Loading branch information
thgreasi committed Apr 12, 2023
1 parent 37c4933 commit 447bb20
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/features/device-logs/lib/read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ async function handleStreamingRead(
if (state === StreamState.Closed) {
return;
}
state = StreamState.Writable;
// Do not switch to Writable, unless we are in a Saturated state.
// Eg: We shouldn't if we are still Buffering waiting for getHistory to finish.
// This way warnings will go to the buffer if we are stil Buffering.
if (state === StreamState.Saturated) {
state = StreamState.Writable;
}
if (dropped) {
const now = Date.now();
onLog({
Expand Down

0 comments on commit 447bb20

Please sign in to comment.