-
Notifications
You must be signed in to change notification settings - Fork 55
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
Task view randomly doesn't work #903
Comments
After investigation and debugging, I think it's the root cause of this issue. When resolving tasks, there is an async function is awaiting.
When awaiting this promise, there is a vscode-gradle/extension/src/Extension.ts Line 185 in f5bf5f8
To describe it simply, a new @badsyntax I'm not very sure about what is |
@CsCherrYY I've been able to replicate this behaviour. Unfortunately it looks like a race condition but it's not clear why. (FYI I have not seen this behaviour in the past, perhaps this race condition is due to a recent change in vscode.) The purpose of This is the prompt the user will see: It would good to understand why this bug occurs (it's really not clear to me) but a possible workaround is to only add this event handler after the server has stopped, possibly in this method: vscode-gradle/extension/src/client/GradleClient.ts Lines 71 to 73 in cd69c0c
(If we add it there we'll need to unsubscribe the event handler after it's called.) I can't think of other use cases that require |
To clarify a bit more, if we don't want the task list updated after the server has restarted then I think it's safe to remove that line. There's also maybe a better way to handle this scenario. |
@badsyntax Thanks a lot for the clarification! It seems a VSCode treeview issue and I just find microsoft/vscode#129019 (though it's about a start-as-closed view, but for other start-as-open views I can sometimes reproduce it) might be related this issue, I'll keep eyes on it. From our side, we can currently have a workaround. For the restarting server scenario, I'm wondering if the view's content would be changed after we call |
Yes I can also replicate the treeview bug when I drag the gradle tasks view into the main file explorer view (start-as-open) and restart vscode (but as you say that issue might still be related).
It makes sense yes. Refreshing will bring the same result in most cases. Maybe I added it for extreme edge cases where maybe the task view was not previously rendered with anything due to a server start failure, but i can't remember and the PR that introduced that change doesn't describe exactly why I added it. I think it's totally fine to remove it 👍 |
Extension Name: vscode-gradle
Extension Version: 3.6.1
OS Version: Windows_NT x64 10.0.19043
VSCode version: 1.59.0-insider
Sometimes, when opening
Gradle
panel in the activity bar,Gradle Tasks
view shows nothingAfter refreshing, it works well.
There is another bug, might come from the same root cause, sometimes
collapse all
button is disabled by defaultit also works after refreshing or other operations (such as run a gradle task, etc.)
The text was updated successfully, but these errors were encountered: