Skip to content

Report trace files that scan cannot read, decompress or parse - #23

Merged
jackfranklin merged 1 commit into
ChromeDevTools:mainfrom
nucliweb:report-skipped-scan-files
Nov 25, 2026
Merged

jackfranklin merged 1 commit into
ChromeDevTools:mainfrom
nucliweb:report-skipped-scan-files

Conversation

@nucliweb

Copy link
Copy Markdown
Contributor

scan lists files that it cannot read, decompress or parse in skippedFiles, with the reason, and continues with the other files. Before, it dropped them silently, so a corrupt .json.gz or a truncated trace looked the same as a trace without matches, and totalFilesScanned still counted it.

A file with invalid JSON is only reported when its text contains the query. The text pre-filter runs before parsing, and a file without the query text cannot match, so it is not missing from the results.

Markdown output adds a "Files Skipped" count and a "Skipped Files" table when there are skipped files. TOON and JSON always include skippedFiles, as an empty list when every file was searched.

Tests cover a corrupt gzip file, truncated JSON, an unreadable file, invalid JSON that cannot match, and the Markdown output. Verified with npm run check, npm run build, npm test and the built CLI on a folder with valid and broken traces.

Fixes the silently skipped files reported in #9.

`scan` lists these files in `skippedFiles` with the reason and continues with the other files. Before, it dropped them silently, so a broken trace looked the same as a trace without matches.

A file with invalid JSON is only reported when its text contains the query, because the text pre-filter runs before parsing and a file without the query text cannot match.
@jackfranklin
jackfranklin merged commit 8459851 into ChromeDevTools:main Nov 25, 2026
9 checks passed
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.

2 participants