Skip to content

fix(freshness): move an unreadable history file aside - #484

Open
MoonBoi9001 wants to merge 6 commits into
mb9/stop-startup-logs-claiming-random-selectionfrom
mb9/keep-unreadable-freshness-file-instead-of-overwriting
Open

MoonBoi9001 wants to merge 6 commits into
mb9/stop-startup-logs-claiming-random-selectionfrom
mb9/keep-unreadable-freshness-file-instead-of-overwriting

Conversation

@MoonBoi9001

Copy link
Copy Markdown
Member

When IISA can't read or parse its saved freshness file at startup, it now renames the file aside with the time in its name and logs an error. Before, it started with no history and its next save, a minute later, replaced the file, so a disk fault or a release that misreads the file lost up to 28 days of freshness history for good.

When IISA can't read or parse its saved freshness file it starts with no history, and its next
save replaced the file, so a disk fault or a release that misreads it lost up to 28 days. It
now renames the file aside with the time in its name and logs an error.
@MoonBoi9001
MoonBoi9001 added this pull request to stack #485 November 20, 2026 11:19
…andom-selection' into mb9/keep-unreadable-freshness-file-instead-of-overwriting
A file moved aside was named by the second, so a 2nd unreadable file in the same second, such
as a restored copy read straight after the original, replaced the 1st. Names now add a random
part.
The error said the next save replaces such a file, but a save can fail too, for example where
the file is a folder, so it now says may. The loading notes say the move happens if it can.
The reason a file couldn't be read already carried its path, so the error line named it twice.
It now gives only the reason.
The test for a file that can't be read only checked that something was moved aside. It now
checks exactly 1 file moved, nothing left at the old name, and an error logged.
@MoonBoi9001
MoonBoi9001 marked this pull request as ready for review November 20, 2026 11:44
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