Skip to content

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

Open
canova wants to merge 1 commit into
firefox-devtools:mainfrom
canova:push-ruskmklkuxou
Open

Handle Text and Log marker payloads with their marker schema#6247
canova wants to merge 1 commit 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.

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 92.85714% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.84%. Comparing base (a62903b) to head (1832c65).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/profile-logic/marker-data.ts 90.47% 2 Missing ⚠️
src/profile-logic/marker-schema.ts 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6247      +/-   ##
==========================================
+ Coverage   83.69%   83.84%   +0.14%     
==========================================
  Files         348      348              
  Lines       37433    37457      +24     
  Branches    10514    10523       +9     
==========================================
+ Hits        31330    31405      +75     
+ Misses       5676     5625      -51     
  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 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?

): 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?

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

3 participants