fix: skip source files that are not valid UTF-8 instead of failing refresh - #38
Merged
Merged
Conversation
…fresh A binary file with a source suffix, such as an HLS video segment saved as `.ts`, made the whole navigation refresh fail. Refresh and the freshness manifest now skip such files and count them as `invalidUtf8` in the exclusions, so the rest of the checkout is still indexed and freshness stays exact. Policy files still fail closed on invalid UTF-8.
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.
One file that was not valid UTF-8 failed the whole navigation refresh, so the checkout got no navigation at all. The case that surfaced it was a checkout with HLS video segments (MPEG transport streams saved as
.ts), the only failure in the 0.4.2 survey (267 of 268 checkouts).invalidUtf8exclusion. The rest of the checkout is indexed. Both paths skip the same files, so freshness stays exact: a skipped file that becomes valid text, or an indexed file that stops being valid, makes the index stale. The statuscompletenessstring names the exclusion..gitignore,.z1p-navigation.json) still fail closed on invalid UTF-8. Quota failures (such asmaxFileBytes) still fail the refresh and keep the prior generation..tsfile, both freshness transitions and search results. The failed-refresh retention test, the unknown-freshness test and the stdio smoke previously used invalid UTF-8 as their failure trigger; they now use an oversized file. The smoke adds aninvalidUtf8SkippedAndCountedcheck, and its second session confirms the same revision with the skipped file present.LOCAL-NAVIGATION.mdandNAVIGATION-SMOKE.md.Checks: the pre-push
npm run checkpassed (34 core and 191 tools tests, the remaining suites and packed-package smoke), plus the navigation stdio smoke and both benchmark gates. Two earlier hook runs under a load average of about 80 on 8 cores timed out tests at vitest's 5-second limit (the existing 10,050-line pagination test, then five untouched core tests); they pass at normal load.Local probe with this build on the affected checkout: 1,920 files indexed, 6 skipped as
invalidUtf8, freshness current after refresh. Single run.Not released; no version bump.