Closed Bug 1746952 Opened 2 years ago Closed 2 years ago

Storage resources reports same-process iframes data twice

Categories

(DevTools :: Storage Inspector, defect)

defect

Tracking

(firefox-esr91 unaffected, firefox95 unaffected, firefox96 disabled, firefox97 fixed)

RESOLVED FIXED
97 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox95 --- unaffected
firefox96 --- disabled
firefox97 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

The storage server codebase missed some tweak to fully support EFT.
For now, data of same-process iframes is reported twice.

This mostly comes from the following code:
https://searchfox.org/mozilla-central/rev/a11b63915bd7810a03635d733123448ab5bfcad3/devtools/server/actors/resources/utils/content-process-storage.js#197-216
that process all the windows, including all the same process iframe ones.
Whereas, when EFT is enabled, only the immediate document of the target actor should be considered. The iframe documents will be handled by distinct targets.

Assignee: nobody → poirot.alex

This test was brittle as it was assuming that only one resource was notified per storage type.
But this wasn't the case since fission or EFT!
We were lucky that the assertion were correct only against the latest resource
and not against the aggregate of the many resource (one per target).

Most children of the target fronts are target scoped actors,
like console, inspector, thread,...
All these target scoped actor's fronts are created via:
https://searchfox.org/mozilla-central/rev/7d17fd1fe9f0005a2fb19e5d53da4741b06a98ba/devtools/shared/protocol/types.js#539-540
And so aren't going throught this types.addActorType inner function.

So fix the targetFront attribute for all fronts created via this read method
where the immediate parent is the targetFront.

We were notifying about same-process storage values twice.
Once with the top document target and another time via the iframe target.
This was probably invisible from the UI. We were probably only updating things twice without any visible breakage.

But this also highlighted that the test was quite wrong.
It was only asserting about the last resource for each storage type.
Luckily, the last resource to be notified was the one from the top document.
So that it contained all the storage values about all the iframes.

When I fix EFT implementation, now, iframe data is only visible in the iframe's related storage resource.
I tweaked the test to correctly assert data against the many resources for a single storage type.

Set release status flags based on info from the regressing bug 1741808

Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6746ca879e1d
[devtools] Acknowledge the distinct storage resource for each target in browser_storage_dynamic_windows.js. r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/81e94060bda3
[devtools] Fix targetFront attribute of all storage resources. r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/bd77231a9a74
[devtools] Avoid notifying about same-process storage values when EFT is enabled. r=nchevobbe
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: