Skip to content

Commit 619df23

Browse files
committed
fix: offset for partial lines
1 parent 18f0a45 commit 619df23

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

internal/remote/firecrest/controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -675,9 +675,10 @@ func (c *FirecrestRemoteSessionController) fetchLogStream(ctx context.Context, s
675675
}
676676

677677
size := 524288 // 512KB
678+
apiOffset := *offset + buf.Len()
678679
params := GetViewFilesystemSystemNameOpsViewGetParams{
679680
Path: filePath,
680-
Offset: offset,
681+
Offset: &apiOffset,
681682
Size: &size,
682683
}
683684

@@ -696,8 +697,6 @@ func (c *FirecrestRemoteSessionController) fetchLogStream(ctx context.Context, s
696697
return
697698
}
698699

699-
*offset += len(content)
700-
701700
// Append new content and flush any complete lines.
702701
if _, err := buf.WriteString(content); err != nil {
703702
slog.Warn("failed to buffer session log content", "stream", stream, "error", err)
@@ -714,6 +713,7 @@ func (c *FirecrestRemoteSessionController) fetchLogStream(ctx context.Context, s
714713
slog.Warn("failed to write session log", "stream", stream, "error", err)
715714
}
716715
buf.Next(idx + 1)
716+
*offset += idx + 1
717717
}
718718
}
719719

0 commit comments

Comments
 (0)