Closed Bug 1654587 Opened 5 years ago Closed 5 years ago

Use single shared module for Debugger settings

Categories

(DevTools :: Debugger, task, P3)

task

Tracking

(firefox83 fixed)

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: jdescottes, Assigned: ochameau)

References

Details

Attachments

(2 files)

The debugger stores its "settings" both in preferences and in the async store.

To interact with the async store, the Debugger uses a helper https://searchfox.org/mozilla-central/source/devtools/client/shared/async-store-helper.js . To interact with preferences, it uses another helper https://searchfox.org/mozilla-central/source/devtools/client/debugger/src/utils/prefs.js . This prefs module also exposes some content from the async-store.

This layer of abstraction is used in the debugger to interact with settings.

However we also read debugger settings in a module which is now loaded by the toolbox: https://searchfox.org/mozilla-central/source/devtools/client/shared/thread-utils.js
For now this module only reads preferences but we are about to also read from the async store, in the scope of https://phabricator.services.mozilla.com/D75157 (Bug 1633727).

Which means we have two modules interacting with the same preferences and async store keys, using sometimes different names. And given the way prefs.js is written (the preferences names are split and harder to grep), there is a risk of maintenance issue.

For some settings (eg eventBreakpoints) we store non trivial structures in the async store. We actually store part of the debugger state, which makes it so that the thread-utils module ends up depending on the precise structure of the debugger state. Someone could very well update the debugger state's shape and completely miss that thread-utils needs to be updated.

We should have a single abstraction to retrieve debugger settings, ideally with a single shared instance between the toolbox and the debugger so that we can avoid race issues.

I thought that was a source of test failure in bug 1620280, and wrote a patch to fix this.
But my test failure was actually related to something else.
Nonetheless, let's fix this given that I have a patch already :)

Assignee: nobody → poirot.alex
Attachment #9178446 - Attachment description: Bug 1654587 - Use a shared asyncStore instance between Debugger Frontend and TargetMixin. → Bug 1654587 - [devtools] Use a shared asyncStore instance between Debugger Frontend and TargetMixin.
Attachment #9178447 - Attachment description: Bug 1654587 - Remove now-unused async-storage and async-store-helper modules. → Bug 1654587 - [devtools] Remove now-unused async-storage and async-store-helper modules.
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/70b213ca2795 [devtools] Use a shared asyncStore instance between Debugger Frontend and TargetMixin. r=jdescottes https://hg.mozilla.org/integration/autoland/rev/69001a563d74 [devtools] Remove now-unused async-storage and async-store-helper modules. r=jdescottes,nchevobbe
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: