Skip to content

Handle Text and Log marker payloads with their marker schema - #6247

Merged
canova merged 2 commits into
firefox-devtools:mainfrom
canova:push-ruskmklkuxou
Aug 10, 2026
Merged

Handle Text and Log marker payloads with their marker schema#6247
canova merged 2 commits into
firefox-devtools:mainfrom
canova:push-ruskmklkuxou

Conversation

@canova

@canova canova commented Aug 6, 2026

Copy link
Copy Markdown
Member

Main | Deploy preview

Fixes #6245

Firefox now outputs the Text marker's name and the Log marker's message as unique strings, so the payload holds a string table index instead of the text itself. The two Text marker PII sanitizers and the MOZ_LOG formatting read those fields directly and threw an error.

This patch fixes these issues by always looking at the marker schema and not having any arbitrary assumptions about some certain marker types. It was a bad idea to have these custom handlings in the past instead of relying on the marker schema in the first place.

@canova
canova requested review from fatadel and mstange August 6, 2026 15:40
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.34884% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.73%. Comparing base (1d84c54) to head (1198e50).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/profile-logic/marker-data.ts 91.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6247      +/-   ##
==========================================
+ Coverage   83.58%   83.73%   +0.14%     
==========================================
  Files         350      350              
  Lines       37498    37523      +25     
  Branches    10539    10543       +4     
==========================================
+ Hits        31343    31420      +77     
+ Misses       5728     5676      -52     
  Partials      427      427              

☔ View full report in Codecov by Harness.
📢 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.

Comment thread src/profile-logic/marker-data.ts
Comment thread src/profile-logic/marker-schema.ts Outdated
Comment on lines +694 to +695
for (const field of markerSchema.fields) {
if (field.key === fieldKey) {

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.

This will iterate the schema fields for every sanitized text marker. In other places we precompute the string index fields per marker type, could we use the precomputed map instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh right. Updated it!

Comment thread src/profile-logic/marker-data.ts Outdated
): string | null {
if ('message' in data) {
if (!data.message) {
const message = resolveLogMarkerMessage(data.message, stringArray);

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.

So here we check the payload whereas in the other place we check the schema. Should we check the schema here too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, looks like I missed that one initially, updated!

Firefox now outputs the Text marker's `name` and the Log marker's
`message` as unique strings, so the payload holds a string table index
instead of the text itself. The two Text marker PII sanitizers and the
MOZ_LOG formatting read those fields directly and threw an error.

This patch fixes these issues by always looking at the marker schema and
not having any arbitrary assumptions about some certain marker types. It
was a bad idea to have these custom handlings in the past instead of
relying on the marker schema in the first place.
@canova
canova force-pushed the push-ruskmklkuxou branch from 1832c65 to 0c71bb8 Compare August 10, 2026 11:09
@canova
canova requested a review from mstange August 10, 2026 11:10
@valenting

Copy link
Copy Markdown
Contributor

Looking forward to this being merged. Currently trying to debug some issues on Nightly profiles, and extractGeckoLogs isn't working.

@canova
canova enabled auto-merge August 10, 2026 14:15
@canova
canova merged commit 356aad5 into firefox-devtools:main Aug 10, 2026
21 checks passed
@canova

canova commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

@valenting Sorry for the issue! I'll deploy it soon. But note that the Firefox patch has been backed out in Nightly, so if you update your Nightly you should be able to use extractGeckoLogs again even without the deploy.

canova added a commit to canova/perf.html that referenced this pull request Aug 10, 2026
…ker changes are picked up in the frontends

The Text marker's `name` and the Log marker's `message` are unique
strings now, so their payloads hold a string table index instead of the
text.

But we realized that the frontend had some hardcoded assumptions about
these marker types, and they weren't looking at the schema at all.
That's fixed in firefox-devtools#6247.

There is nothing to upgrade because the frontend reads the field format
from the marker schema. But since older frontends read these two fields
directly, this bump makes sure that they get updated.

Bugzilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=2054010
canova added a commit to canova/perf.html that referenced this pull request Aug 10, 2026
…ker changes are picked up in the frontends

The Text marker's `name` and the Log marker's `message` are unique
strings now, so their payloads hold a string table index instead of the
text.

But we realized that the frontend had some hardcoded assumptions about
these marker types, and they weren't looking at the schema at all.
That's fixed in firefox-devtools#6247.

There is nothing to upgrade because the frontend reads the field format
from the marker schema. But since older frontends read these two fields
directly, this bump makes sure that they get updated.

Bugzilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=2054010
canova added a commit that referenced this pull request Aug 10, 2026
…ker changes are picked up in the frontends (#6252)

The Text marker's `name` and the Log marker's `message` are unique
strings now, so their payloads hold a string table index instead of the
text.

But we realized that the frontend had some hardcoded assumptions about
these marker types, and they weren't looking at the schema at all.
That's fixed in #6247.

There is nothing to upgrade because the frontend reads the field format
from the marker schema. But since older frontends read these two fields
directly, this bump makes sure that they get updated.

Bugzilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=2054010
@canova canova mentioned this pull request Aug 10, 2026
canova added a commit that referenced this pull request Aug 10, 2026
Changes:

[fatadel] Create the Network track from the timeline-network schema
display location (#6224)
[Markus Stange] Only call `getRawFrameTableBuilderWithExistingContents`
once per symbolication batch. (#6233)
[fatadel] Improve discoverability of downloading a local profile (#6216)
[Nazım Can Altınova] Handle the cli daemon startup failures more
gracefully with better errors (#6241)
[Nazım Can Altınova] Add the ability to apply source maps from the CLI
(#6229)
[Nazım Can Altınova] Handle Text and Log marker payloads with their
marker schema (#6247)
[Nazım Can Altınova] Bump the Gecko profile version to make sure that
the Text and Log marker changes are picked up in the frontends (#6252)
[fatadel] Deactivate a menu button as soon as its panel is dismissed
(#6251)
[Nazım Can Altınova] 🔃 Sync: l10n -> main (August 10, 2026) (#6253)
[Nazım Can Altınova] Bump profiler-cli version to 0.8.0 (#6254)

And special thanks to our localizers:

de: Ger
de: Michael Köhler
el: George kitsoukakis
en-CA: chutten
en-CA: Saurabh
en-GB: Ian Neal
es-CL: ravmn
fy-NL, nl: Fjoerfoks
fr: Théo Chevalier
fy-NL: Fjoerfoks
ia: Melo46
it: Francesco Lodolo [:flod]
nl: Fjoerfoks
ru: michellemelsspam
ru: Valery Ledovskoy
tr: giray
tr: Selim Şumlu
zh-TW: Pin-guang Chen
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.

Sanitization throws an error for some makers that we have some hardcoded assumptions about their fields

4 participants