Skip to content

Translate URL track-index state through profile sanitization#6000

Open
fatadel wants to merge 1 commit intofirefox-devtools:mainfrom
fatadel:issue-2947
Open

Translate URL track-index state through profile sanitization#6000
fatadel wants to merge 1 commit intofirefox-devtools:mainfrom
fatadel:issue-2947

Conversation

@fatadel
Copy link
Copy Markdown
Contributor

@fatadel fatadel commented May 6, 2026

Previously, hidden non-thread tracks (screenshots, network, IPC) reappeared after publishing a sanitized profile when sanitization also removed a thread: the URL state's hidden-track sets and track-order were reset whenever threads were re-indexed, even though the non-thread tracks still existed in the sanitized profile.

attemptToPublish now builds an old to new TrackIndex map by matching tracks on stable identity (pid, screenshot id, threadIndex, counterIndex, visual-progress singleton) and translates hiddenGlobalTracks, globalTrackOrder, hiddenLocalTracksByPid, and localTrackOrderByPid through it on SANITIZED_PROFILE_PUBLISHED. Marker tracks key on a string-table index that sanitization reshuffles, so they are not matched.

Fixes #2947.
The work is built upon the draft PR by @julienw.

STR are available in the original issues, here is the deploy preview profile.

Previously, hidden non-thread tracks (screenshots, network, IPC)
reappeared after publishing a sanitized profile when sanitization also
removed a thread: the URL state's hidden-track sets and track-order were
reset whenever threads were re-indexed, even though the non-thread
tracks still existed in the sanitized profile.

attemptToPublish now builds an old to new TrackIndex map by matching
tracks on stable identity (pid, screenshot id, threadIndex,
counterIndex, visual-progress singleton) and translates
hiddenGlobalTracks, globalTrackOrder, hiddenLocalTracksByPid, and
localTrackOrderByPid through it on SANITIZED_PROFILE_PUBLISHED. Marker
tracks key on a string-table index that sanitization reshuffles, so
they are not matched.

Fixes firefox-devtools#2947
@fatadel fatadel requested review from canova and mstange May 6, 2026 16:17
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 86.06557% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.82%. Comparing base (ffeadea) to head (0625a02).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/actions/publish.ts 73.07% 14 Missing ⚠️
src/profile-logic/tracks.ts 96.66% 2 Missing ⚠️
src/reducers/url-state.ts 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6000      +/-   ##
==========================================
+ Coverage   83.81%   83.82%   +0.01%     
==========================================
  Files         328      328              
  Lines       34253    34370     +117     
  Branches     9569     9512      -57     
==========================================
+ Hits        28710    28812     +102     
- Misses       5115     5130      +15     
  Partials      428      428              

☔ 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.

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.

Some hidden tracks reappear after sanitization

1 participant