Skip to content

Fix two confused upgraders which didn't expect to be run on the serialized format.#5285

Merged
mstange merged 2 commits into
firefox-devtools:mainfrom
mstange:push-vxrrorlzuonx
Jan 2, 2025
Merged

Fix two confused upgraders which didn't expect to be run on the serialized format.#5285
mstange merged 2 commits into
firefox-devtools:mainfrom
mstange:push-vxrrorlzuonx

Conversation

@mstange

@mstange mstange commented Jan 2, 2025

Copy link
Copy Markdown
Contributor

The upgrader for version 50 had a misleading comment, and the upgrader for version 41 had broken code in a code path that's never taken.

@mstange mstange requested a review from canova January 2, 2025 16:11
@codecov

codecov Bot commented Jan 2, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 88.61%. Comparing base (4da6be0) to head (62becba).

Files with missing lines Patch % Lines
src/profile-logic/processed-profile-versioning.js 0.00% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5285      +/-   ##
==========================================
- Coverage   88.62%   88.61%   -0.02%     
==========================================
  Files         308      308              
  Lines       28121    28125       +4     
  Branches     7620     7621       +1     
==========================================
  Hits        24923    24923              
- Misses       2984     2987       +3     
- Partials      214      215       +1     

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

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch!

I asked for this comment in firefox-devtools#5033 but I was confused.
The upgraders run before we convert the profile from the serialized format
to the in-memory format.
This upgrader expects thread.stringTable to be a StringTable.
But upgraders run on the serialized version of the profile,
so threads only have a stringArray, and no stringTable. So this
code could never have worked. This must mean that the code path
isn't taken very often, i.e. that it's unlikely to encounter a
resource without a name.

Even so, it's better to fix it so that future readers don't get confused.
@mstange mstange force-pushed the push-vxrrorlzuonx branch from 62becba to d5ee7f7 Compare January 2, 2025 20:13
@mstange mstange enabled auto-merge January 2, 2025 20:13
@mstange mstange merged commit fa69611 into firefox-devtools:main Jan 2, 2025
@julienw julienw mentioned this pull request Jan 15, 2025
julienw added a commit that referenced this pull request Jan 15, 2025
Updates:

[Nicolas Chevobbe] Adapt Keyboard shortcut dialog in High Contrast Mode. (#5245)
[Nicolas Chevobbe] Fix sidebar-toggle in High Contrast Mode. (#5246)
[Nicolas Chevobbe] Fix timeline selection overlay time / hover line in High Contrast Mode (#5247)
[Zac Spitzer] fix broken link for processed profile format (#5267)
[Greg Tatum] Update the memory allocation docs and add DHAT docs (#5270)
[Markus Stange] Simplify some code related to thread CPU deltas (#5265)
[Greg Tatum] Update dhat convertor to work better with valgrind (#5269)
[Markus Stange] Rename UniqueStringArray to StringTable. (#5283)
[Markus Stange] Use snapshot testing in the symbolicator CLI test. (#5284)
[Markus Stange] Fix two confused upgraders which didn't expect to be run on the serialized format. (#5285)
[Nicolas Chevobbe] Fix timelineSettingsHiddenTracks in High Contrast Mode. (#5250)
[Julien Wajsberg] Fix some test and non-test warnings (#5294)
[Nisarg Jhaveri] Support importing simpleperf trace files from Android Studio (#5212)
[Sean Kim] Add HTTP response status code in the profiler network tab (#5297)
[Markus Stange] Change StringTable API a bit. (#5286)
[Markus Stange] Correctly declare imported simpleperf trace profiles to be of the current version. (#5312)
[Markus Stange] Two small changes (#5313)
[Nazım Can Altınova] Show sample tooltips on sample graph hover (#5298)

Also thanks to our localizers:

en-CA: chutten
es-CL: ravmn
es-CL: ravmn
fr: Théo Chevalier
ia: Melo46
ia: Melo46
sv-SE: Andreas Pettersson
uk: Lobodzets
zh-TW: Olvcpr423
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