Repository navigation
Date a game's log by its newest line, not its first - #591
Open
thehobbit85 wants to merge 1 commit into
Open
thehobbit85 wants to merge 1 commit into
thehobbit85 wants to merge 1 commit into
Conversation
A log the game adds to on every start begins with its first session's date. The crash log picker read only the first date, so from the day after that session such a log counted as an old renamed copy, and the crash at its end was never shown. The newest date in the log's start or end now decides; a renamed or copied log has only old dates and still counts as old.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Found while auditing the crash-log reports (#356 and others).
The crash window, reports and Export Logs pick the game's newest log, but skip one that
old_insidecalls old: a log whose first date is more than a day before the game started, meaning a file a game renamed or copied. It read only the first date in the file's first 400 bytes. A log the game adds to on every start (an appending log file, the default for some logging libraries) begins with its first session's date. So from the day after that session, the log counted as old, and the crash written at its end was never shown.The newest date found in the log's first 400 bytes or its last 4 KB now decides. A log the game added to today has today's date at its end. A renamed or copied log has only old dates at both ends and still counts as old.
Limits: no report in the tracker shows this directly. It's a gap in the check's own stated purpose, found while reading the crash-log code.
How you tested it
Run on macOS against
eaf7ca2, with synthetic logs.New test: a log that starts on 2020-01-01 and ends with today's crash line. On
mainit counted as old; with this change it doesn't.Control test: a log with only old dates is still old.
Rust: 1,217 passed, 1 ignored. UI: 1,019 passed, 11 skipped.
git diff --checkclean.npm testpassesnode --test tests/*.test.cjspassesTried it in the launcher (
npm run dev)Checklist
recomplauncher.json