Skip to content

Logs page drops a valid event when the tail window starts on a line boundary #1093

Description

@rowkav09

Severity: P4.

readLogTail reads the last maxBytes and always throws away the first line, in case the window started mid-line. When the window happens to start exactly at the beginning of a line, that first line is whole and valid, and it gets dropped.

Repro on main (ten identical-length 97 byte events C00 to C09):

await readLogTail(file, { maxBytes: 97 * 4 })      // [C07, C08, C09]  (expected C06..C09)
await readLogTail(file, { maxBytes: 97 * 4 + 1 })  // [C06, C07, C08, C09]

Fix: read one byte before the window, so the first piece is either the end of a cut-off line or empty, and only then drop it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions