-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix trace explorer / welcome page refresh corner cases #230
Fix trace explorer / welcome page refresh corner cases #230
Conversation
306f539
to
901c9b2
Compare
Video showing fix for #227: |
Video showing fix for #228 |
Video showing fix for #229 |
901c9b2
to
0b9403e
Compare
@williamsyang-work I found some corner cases for the refresh of the trace-explorer/welcome-view that this PR addresses. Please let me know if have any comments for this PR. |
0b9403e
to
3655854
Compare
|
||
RestClient.addConnectionStatusListener(status => { | ||
// Ignore the first update that is sent when calling addConnectionStatusListener | ||
if (this._initialized) { | ||
this._signalHandler?.notifyConnection(status); | ||
} | ||
}); | ||
this._initialized = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar pattern to this: f565c23.
I wonder if there's a cleaner way to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@williamsyang-work I'm not sure what you mean. What do you suggest to make it cleaner? Please let me know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do like the implementation that William points-out slightly better. However this is simple enough that I don't mind either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think I understand how to change it. I'll update the PR (including a rebase).
Thanks for the assist on this @bhufmann :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Very nice improvements for several corner-cases! Not only the views refresh correctly but it happens quicker now, without that little delay that was there in some cases previously. I confirmed that that 3 linked issues now seem resolved.
Call it from the webview dispose handler. Sub-class can add their own implementation and call super implementation. This avoids that the class is using the webview instance after it is disposed. Signed-off-by: Bernd Hufmann <[email protected]>
The TSP client implementation notifies clients when the method addConnectionStatusListener() is called. This can lead to incorrect state in on client side. Signed-off-by: Bernd Hufmann <[email protected]>
This method set the status bar and the serverUp context that is used to decide whether the trace explorer or the welcome view should be rendered. This method doesn't check the backend to get status in comparison to checkAndUpdateServerStatus. It's useful when it's known that the server is down or up (e.g. after start notification). In this case, it is not necessary to check the backend again. Don't set the status in the method isTraceServerUp() because it should not have side-effects that are not expected. Initialize and refresh flags traceViewer.serverUp and trace-explorer.noExperiments to ensure the correct view is rendered, i.e. Trace Explorer or Welcome view, when certain event happen (e.g. server started or stopped). Fixes eclipse-cdt-cloud#227 Fixes eclipse-cdt-cloud#228 Signed-off-by: Bernd Hufmann <[email protected]>
For the case that with current URL the welcome view is rendered due to noExperiment or server is down, this will render the trace explorer (or welcome view) after a server URL change. Without calling refresh, the welcome view stays, even if the other server has experiments. Fixes eclipse-cdt-cloud#229 Signed-off-by: Bernd Hufmann <[email protected]>
3655854
to
1f6b33a
Compare
This PR consists of multiple commits that fixes refresh corner cases.
Add default dispose() method to AbstractTraceExplorerProvider
Call it from the webview dispose handler. Sub-class can add their own implementation and call super implementation. This avoids that the class is using the webview instance after it is disposed.
Ignore connection status listener notification in constructor
The TSP client implementation notifies clients when the method
addConnectionStatusListener()
is called. This can lead to incorrect state in on client side.Add method to set server status in TraceServerStatusService
This method set the status bar and the
traceViewer.serverUp
context that is used to decide whether the trace explorer or the welcome view should be rendered. This method doesn't check the backend to get status in comparison tocheckAndUpdateServerStatus
. It's useful when it's known that the server is down or up (e.g. after start notification). In this case, it is not necessary to check the backend again. Don't set the status in the methodisTraceServerUp()
because it should not have side-effects that are not expected. Initialize and refresh flagstraceViewer.serverUp
andtrace-explorer.noExperiments
to ensure the correct view is rendered, i.e. Trace Explorer or Welcome view, when certain events happen (e.g. server started or stopped).Fixes Trace Explorer not refreshed after first trace server started indication #227
Fixes Welcome Page not rendered after trace server stopped indication (intermittent) #228.
Refresh trace viewer after server URL preference changes
For the case that with current URL the welcome view is rendered due to no experiments on server, or the server is down, this will render the trace explorer (or welcome view) after a server URL change. Without calling refresh, the welcome view stays, even if the other server has experiments.
Fixes Trace Explorer/Welcome page not refreshed when updating the server URL (corner case) #229
Signed-off-by: Bernd Hufmann [email protected]