Skip to content

Allow loading gzipped profiles from more endpoints#5215

Merged
julienw merged 2 commits into
firefox-devtools:mainfrom
nisargjhaveri:gzip_post_message
Dec 2, 2024
Merged

Allow loading gzipped profiles from more endpoints#5215
julienw merged 2 commits into
firefox-devtools:mainfrom
nisargjhaveri:gzip_post_message

Conversation

@nisargjhaveri

Copy link
Copy Markdown
Contributor

Fix #5214

  • Move gzip handling to unserializeProfileOfArbitraryFormat method to enable proper handling of gzipped profiles from more endpoints
  • Fix tests which were incorrectly passing promise as payload instead of the compressed profile as ArrayBuffer.

- Move gzip handling to unserializeProfileOfArbitraryFormat method to enable proper handling of gzipped profiles from more endpoints
- Fix tests which were incorrectly passing promise as payload instead of the compressed profile as ArrayBuffer.
@codecov

codecov Bot commented Nov 19, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.62%. Comparing base (8764e83) to head (72137d5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5215   +/-   ##
=======================================
  Coverage   88.62%   88.62%           
=======================================
  Files         308      308           
  Lines       28059    28059           
  Branches     7598     7598           
=======================================
  Hits        24867    24867           
  Misses       2978     2978           
  Partials      214      214           

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


🚨 Try these New Features:

@julienw

julienw commented Nov 26, 2024

Copy link
Copy Markdown
Contributor

Thanks, I've been wanting to do that for some time. We'll try to look at it shortly!

@julienw julienw self-requested a review November 26, 2024 18:02
const { getState, view } = await setupTestWithFile({
type: '',
payload: compress(serializeProfile(profile)),
payload: (await compress(serializeProfile(profile))).buffer,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is the problem that this was returned an UInt8Array but other APIs were wanting a ArrayBuffer?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The problem was, this was returning promise whereas it was expecting ArrayBuffer. The promise was getting converted to empty object, which did not throw any errors as it went into some other path. Sorry, I don't recall the exact path it took now, but I understood it was not testing what we wanted.

@julienw julienw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, this looks good to me.

@julienw julienw enabled auto-merge (squash) December 2, 2024 17:10
@julienw julienw merged commit 8131003 into firefox-devtools:main Dec 2, 2024
@canova canova mentioned this pull request Dec 12, 2024
canova added a commit that referenced this pull request Dec 12, 2024
[Sean Kim] Add Class of Service for a request in the profiler network
tab (#5228)
[Nisarg Jhaveri] Allow loading gzipped profiles from more endpoints
(#5215)
[Nicolas Chevobbe] Adapt Tree row toggle button to High Contrast Mode.
(#5238)
[Jon Coppeard] Display malloc heap size data in GCMajor markers (#5239)
[Nicolas Chevobbe] Opt-out of forced-colors for colored-square and
colored-border (#5237)
[Yuval Mizrachi] Support colored bandwidth and memory tracks (#5232)
[Nicolas Chevobbe] Adapt context menu to High Contrast Mode (#5244)
[Nazım Can Altınova] Show Chrome extension instructions in the homepage
if visited from Chromium browsers (#5251)

And thanks to our localizers:
de: Michael Köhler
en-GB: Ian Neal
fr: Théo Chevalier
fr: felash
fy-NL: Fjoerfoks
it: Francesco Lodolo [:flod]
nl: Mark Heijl
pt-BR: Marcelo Ghelman
ru: Valery Ledovskoy
uk: Francesco Lodolo [:flod]
uk: Markevych Dmytro Vitaliyovych
zh-CN: Olvcpr423
tenderlove pushed a commit to tenderlove/profiler that referenced this pull request Dec 21, 2024
…5215)

- Move gzip handling to unserializeProfileOfArbitraryFormat method to enable proper handling of gzipped profiles from more endpoints
- Fix tests which were incorrectly passing promise as payload instead of the compressed profile as ArrayBuffer.
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.

Loading profiles from post message does not support gzipped profiles

2 participants