Skip to content

Fix loading .json.gz profiles from inside zip archives#5959

Merged
canova merged 1 commit intofirefox-devtools:mainfrom
canova:zip-gzipped
Apr 21, 2026
Merged

Fix loading .json.gz profiles from inside zip archives#5959
canova merged 1 commit intofirefox-devtools:mainfrom
canova:zip-gzipped

Conversation

@canova
Copy link
Copy Markdown
Member

@canova canova commented Apr 21, 2026

This fixes #5958.

When clicking a .json.gz entry in a zip file, viewProfileFromZip called file.async('string'), which decoded the gzip bytes as UTF-8 and corrupted the stream before unserializeProfileOfArbitraryFormat could detect the gzip magic and decompress. Switching to 'uint8array' keeps the content binary so the existing isGzip/decompress path runs. Plain .json entries still work via the Uint8Array to TextDecoder fallback.

Example profile

When clicking a .json.gz entry in a zip file, viewProfileFromZip called
file.async('string'), which decoded the gzip bytes as UTF-8 and
corrupted the stream before unserializeProfileOfArbitraryFormat could
detect the gzip magic and decompress. Switching to 'uint8array' keeps
the content binary so the existing isGzip/decompress path runs. Plain
.json entries still work via the Uint8Array to TextDecoder fallback.
@canova canova requested a review from fatadel April 21, 2026 08:50
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.33%. Comparing base (4308a73) to head (285d242).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5959      +/-   ##
==========================================
- Coverage   85.37%   85.33%   -0.04%     
==========================================
  Files         322      322              
  Lines       32069    32117      +48     
  Branches     8814     8827      +13     
==========================================
+ Hits        27378    27408      +30     
- Misses       4260     4278      +18     
  Partials      431      431              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@fatadel fatadel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@canova canova merged commit 2e7e9ab into firefox-devtools:main Apr 21, 2026
20 of 21 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.

Cannot open .json.gz profiles in a .zip archive

2 participants