Repository navigation
fix: don't double multi-part extensions when saving files - #2303
Closed
serhiizghama wants to merge 2 commits into
Closed
serhiizghama wants to merge 2 commits into
serhiizghama wants to merge 2 commits into
Conversation
path.extname only strips the last segment, so saving a trace to trace.json.gz produced trace.json.json.gz. Skip the strip/re-append when the path already ends with the requested extension.
OrKoN
reviewed
Jul 6, 2026
OrKoN
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the PR. It looks like some tests fail but I also wonder let's just enforce .gz instead of .json.gz?
Collaborator
|
I have opened a PR for that #2303 |
jozef-javorsky-dodo
pushed a commit
to jozef-javorsky-dodo/chrome-devtools-mcp
that referenced
this pull request
Jul 6, 2026
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.
Saving a performance trace to a compressed path like
trace.json.gz(the exact example in theperformance_start_trace/performance_stop_traceschema) writes it totrace.json.json.gzinstead.The cause is in
ensureExtension: it strips the current extension withpath.extnameand re-appends the target one, butpath.extname("trace.json.gz")only returns.gz. So it strips.gz→trace.json, then appends.json.gz→trace.json.json.gz. The compressed-trace tools pass.json.gzas the extension, so this hits any trace saved to a.gzpath.Fix is to skip the strip-and-reappend when the path already ends with the requested extension. Single-segment extensions and the replace-a-different-extension case (e.g.
result.jpg→.png) are unchanged; added a couple of cases to the existingensureExtensiontest to lock in the.json.gzbehavior.