[symbols] other actions should be able to wait on symbols completing
We our getSymbols action is currently doing some work that should be done in better places.
diff --git a/src/actions/ast.js b/src/actions/ast.js
index 0efec8708..665972e57 100644
--- a/src/actions/ast.js
+++ b/src/actions/ast.js
@@ -71,10 +71,10 @@ export function setSymbols(sourceId: SourceId) {
- if (isPaused(getState())) {
- await dispatch(fetchExtra());
- await dispatch(mapFrames());
- }
await dispatch(setPausePoints(sourceId));
await dispatch(setSourceMetaData(sourceId));
diff --git a/src/actions/pause/paused.js b/src/actions/pause/paused.js
index 5f91f68c1..1f36d776d 100644
--- a/src/actions/pause/paused.js
+++ b/src/actions/pause/paused.js
@@ -68,6 +68,7 @@ export function paused(pauseInfo: Pause) {
dispatch(removeBreakpoint(hiddenBreakpointLocation));
}
+ await dispatch(setSymbols());
await dispatch(mapFrames());
const selectedFrame = getSelectedFrame(getState());
@@ -77,6 +78,7 @@ export function paused(pauseInfo: Pause) {
dispatch(togglePaneCollapse("end", false));
await dispatch(fetchScopes());
+ await dispatch(fetchExtra());
// Run after fetching scoping data so that it may make use of the sourcemap
// expression mappings for local variables.
With this approach the paused thunk can wait for symbols and then expect mapFrames to succeed and later fetch extra information.
For this strategy to work we should borrow ideas from loadSourceText where we save the pending thunk in a map so that other actions can await the initial load as well. We could do something similar here.
/claim
Thanks for claiming the issue! :wave:
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
How's it going @nagpalm7?
I was travelling for few days so I forgot about this issue. I will see to it today. @jasonLaster
if (isPaused(getState())) {
await dispatch(fetchExtra());
await dispatch(mapFrames());
}
await dispatch(fetchExtra()); is no longer used so not calling it after fetching mapFrames. @jasonLaster
Firefox Developer Tools (including Debugger tool) development is now entirely happening in Bugzilla and new issues should be reported here: https://bugzilla.mozilla.org/enter_bug.cgi?product=DevTools&component=Debugger
Please reopen this report in Bugzilla if it's still valid.
Honza