-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Notifications: if finished before delay starts the notification still shows briefly #93029
Comments
Makes sense. I actually went with 500ms. Note that explorer shows progress on startup only after 800ms delay and search shows progress only after 300ms. So just for reference. Fixed via a47badb |
This can be verified via the test plan item #92914 , thus adding label on-testplan |
We are passing a delay to the notification service here
@bpasero is there something I am missing in the notification service? |
I am not sure I can reproduce an issue with regards to the Have an extension with the following code: vscode.window.withProgress({
location: vscode.ProgressLocation.Notification,
title: 'Progress Title'
}, step => {
step.report({
message: 'Sub message'
});
return new Promise(resolve => {
setTimeout(() => {
resolve();
}, 5000);
});
}); Add an artificial delay of 3000ms here:
e.g. options = {
...options,
delay: 3000
}; The notification with progress only appears after 3 seconds. |
@bpasero thanks for trying it out. Sorry for pinging you before I tried it out - I can also not reproduce this. |
@isidorn I was under the impression that my initial comment for this issue explains the problem in a reproducible way: To repro replace the "nextRequest" method of mockDebug by the following: protected nextRequest(response: DebugProtocol.NextResponse, args:
DebugProtocol.NextArguments): void {
const ID = '' + this._progressId++;
this.sendEvent(new ProgressStartEvent(ID, "Step"));
this.sendEvent(new ProgressUpdateEvent(ID, "update"));
this._runtime.step();
this.sendEvent(new ProgressEndEvent(ID, "end"));
this.sendResponse(response);
} Did you actually try to reproduce the issue with this step? |
@weinand no I did not try to repro with that step, I did try now and the issue is the following: @bpasero to reproduce in your example from your comment above in
In your extension sample, use a timeout of 0, not 5000 for the vscode.window.withProgress({
location: vscode.ProgressLocation.Notification,
title: 'Progress Title'
}, step => {
step.report({
message: 'Sub message'
});
return new Promise(resolve => {
setTimeout(() => {
resolve();
}, 0);
});
}); |
@bpasero a potential solution: here in the
|
I think this is a consequence of always waiting for |
@bpasero thanks for fixing this. |
If I want to use progress events for operations that may take long in some cases, but are mostly short running, I run into the problem that I do not know upfront whether to send progress events or not.
That means I always have to use progress so that progress is displayed if I need them.
This results in flicker in the notification "bell".
To repro replace the "nextRequest" method of mockDebug by the following:
If you now step through a Readme.md the little red dot on the bell flashes and if notifications are open I even see a notification popping up and disappearing immediately.
I suggest that we only show the progress UI if the progress runs longer than some threshold (e.g. 500 ms).
The text was updated successfully, but these errors were encountered: