Skip to content

Commit

Permalink
Don't Send First OpenedTracesChanged Signal
Browse files Browse the repository at this point in the history
With the implementation of a welcome-view as a replacement for the
PlaceholderWidget, the opened traces webview is only displayed
when there are opened traces.  This created complications because the
front-end, which directly communicates with the server, is no longer
rendered. Communication is lost, and so is the tracking of state.

This created an edge-case bug where a user would open a trace at the
same time as starting the trace-server.

1. The extension back-end recognizes that a trace has been opened, and
   sets the 'noExperiment' context to false.
2. When 'noExperiment' is false, the opened-traces front-end is rendered.
3. The front-end then pings the server for the amount of opened traces,
   but this ping happens before the trace is finished loading
4. The server returns 'no opened traces'.
5. 'no opened traces' is sent to the extension backend.
6. The 'noExperiment' context is then set to false.
7. the webview is hidden and welcome-view is displayed

This leaves the user stuck and needing to open another trace in order to
resume use of the Trace Viewer.

Stopping the propagation of the first OpenedTracesChanged signal fixes
this bug.

Signed-off-by: Will Yang <[email protected]>
  • Loading branch information
williamsyang-work committed Mar 18, 2024
1 parent 67c7716 commit f565c23
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ class TraceExplorerOpenedTraces extends React.Component<{}, OpenedTracesAppState
signalManager().off(Signals.OPENED_TRACES_UPDATED, this.onUpdateSignal);
}

private initialized = false;
protected doHandleOpenedTracesChanged(payload: OpenedTracesUpdatedSignalPayload): void {
if (!this.initialized) {
this.initialized = true;
return;
}
this._signalHandler.updateOpenedTraces(payload.getNumberOfOpenedTraces());
}

Expand Down

0 comments on commit f565c23

Please sign in to comment.