Open Bug 1494428 Opened Last year Updated 7 months ago

[remote-dbg-next] watchRuntime action is firing SUCCESS before finishing all async processing


(DevTools :: about:debugging, enhancement, P3)



(Not tracked)


(Reporter: jdescottes, Unassigned)


(Blocks 1 open bug)


(Whiteboard: remote-debugging-technical-debt)

Follow up to Bug 1493968.

We have the following action: 

function watchRuntime(id) {
  return async (dispatch, getState) => {
    dispatch({ type: WATCH_RUNTIME_START });

    try {
      if (id === RUNTIMES.THIS_FIREFOX) {
        // THIS_FIREFOX connects and disconnects on the fly when opening the page.
        await dispatch(connectRuntime(RUNTIMES.THIS_FIREFOX));

      // The selected runtime should already have a connected client assigned.
      const runtime = findRuntimeById(id, getState().runtimes);
      await dispatch({ type: WATCH_RUNTIME_SUCCESS, runtime });

    } catch (e) {
      dispatch({ type: WATCH_RUNTIME_FAILURE, error: e.message });


The final dispatch is made with 

  await dispatch({ type: WATCH_RUNTIME_SUCCESS, runtime });

but after that we dispatch other asynchronous actions that will retrieve the various targets. I think the overall idea is fine as we want to start displaying the runtime page as soon as we can monitor the client, and maybe don't wan't to wait for targets to arrive.

However maybe we should have another dispatch at the end when all targets have been retrieved. Or we should have a loading indicator in the target panels to show that we are currently trying to fetch data.
Priority: -- → P2
Moving to Reserve Backlog for now.
Priority: P2 → P3
Note that this cleanup would allow for a safer way to wait for about:debugging to be ready. See
filter on remote-debugging-next-move-m3-to-m2
filter on remote-debugging-next-move-m3-to-m2
filter on remote-debugging-next-move-m3-to-m2
No longer blocks: remote-debugging-ng-m3
Whiteboard: old-remote-debugging-ng-m3

filter on: remote-debugging-m2-reserve-cleanup

Whiteboard: old-remote-debugging-ng-m3 → remote-debugging-technical-debt
You need to log in before you can comment on or make changes to this bug.