debugger icon indicating copy to clipboard operation
debugger copied to clipboard

[symbols] other actions should be able to wait on symbols completing

Open jasonLaster opened this issue 7 years ago • 6 comments

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.

jasonLaster avatar Dec 18 '18 14:12 jasonLaster

/claim

nagpalm7 avatar Jan 02 '19 18:01 nagpalm7

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!

claim avatar Jan 02 '19 18:01 claim

How's it going @nagpalm7?

jasonLaster avatar Jan 07 '19 20:01 jasonLaster

I was travelling for few days so I forgot about this issue. I will see to it today. @jasonLaster

nagpalm7 avatar Jan 08 '19 04:01 nagpalm7

if (isPaused(getState())) {
       await dispatch(fetchExtra());
      await dispatch(mapFrames());
    }

await dispatch(fetchExtra()); is no longer used so not calling it after fetching mapFrames. @jasonLaster

nagpalm7 avatar Jan 08 '19 20:01 nagpalm7

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

janodvarko avatar Feb 26 '21 14:02 janodvarko