Skip to content

feat: read rotated backups so history does not vanish at 5 MB #9

Description

@GabrielBBaldez

The extension only ever reads errors-ai.log. The library's default is 5 MB with 1 backup: at the cap the live file is rotated to errors-ai.log.1 and a fresh one starts.

So the list you are working from drops from hundreds of reports to one, instantly, with no explanation.

FORMAT.md explicitly designs for readers to merge them: backups carry their own header, and chronological reconstruction across backups uses the entry timestamps.

The README used to claim the view refreshed "across rotation" — that was true of the refresh and false of the data, and the claim has been removed pending this.

What to do

In locateLogFile() / the provider: read errors-ai.log plus errors-ai.log.<n> (bounded, oldest first), concatenate, and dedupe by (id, timestamp).

This needs a real parsed timestamp to sort on. The parser currently keeps the timestamp as an opaque string and the view relies on reverse file order (.reverse() in extension.ts:61), so parsing it into a Date is a prerequisite — and also fixes ordering when two JVMs interleave writes to the same file.

Verify

A test with a main log and a .1 backup asserting both sets of reports appear, in timestamp order, with no duplicates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions