-
Notifications
You must be signed in to change notification settings - Fork 326
Infinite spinner while trying to load property editor #8144
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
Comments
Attaching a spinning ball case: |
I think the attachment is missing. I had to add .txt to the file extension to get github to accept it. |
I can reproduce this in Android Studio. I saw it consistently yesterday, however today I was able to load the property editor once, however it usually fails. When it fails, the property editor connects to DTD and connects to the Service stream, but it is not told about any services (like the Editor services), and therefore doesn't initialize. I enabled the analysis server instrumentation log and confirmed that Android Studio was calling When I review my running processes, I can see a single DTD instance, and I can see that DevTools was started with a DTD URI that matches the one the analysis server connected to.. However I also see another DevTools running, that does not have a Based on this, my current theory (with zero knowledge of how the plugins work) is that Android Studio is somehow spawning two DevTools servers. One is correctly being provided a DTD URI (for the DTD that Android Studio started), but the second is not, and is therefore spawning its own DTD, and that's the server being used by the Property Editor panel. Since this is intermittent, I wonder if there is a race here, and when it works, only one DevTools server was spawned (or, both were spawned after DTD was started and therefore were provided the same/correct DTD URI). |
I missed it in the list before, but I do also see the second instance of DTD in the process list, but it is spawned as I don't think I know enough about the plugins to debug this any further, but perhaps it will be useful to someone more familiar with them. |
@jwren @alexander-doroshko I had a quick search across the plugin code to see if I could spot anything. I found that DevTools is spawned here: The Fixing that (for example by setting |
I did as well, but it keeps getting rejected by GitHub. |
Thanks for the digging @DanTup! DevTools is also potentially spawned in the Flutter Plugin here: flutter-intellij/flutter-idea/src/io/flutter/run/daemon/DevToolsService.java Lines 168 to 182 in 944aa02
If What's interesting is that this fallback to create a DevTools instance here may be entirely unnecessary and was only in place to support a time when the Dart plugin wasn't creating one itself (or unreliably). As that time was long ago, at least since JetBrains/intellij-plugins@9182286, we can probably safely skip this fallback and I'm exploring what that might mean. Whether or not we can do away with that instance creation, I'm also wondering about getting the DevTools instance information properly cached for the views that need to access it. In particular, what I don't know is whether we need to put a wait condition around
That said, the containing method (fyi @elliette who may have more insight as I'm just getting my head wrapped around all of this.) Another thing that could be confusing folks debugging is whether they've got a flutter-intellij/flutter-idea/src/io/flutter/run/daemon/DevToolsService.java Lines 140 to 165 in 944aa02
There's also the (slim) chance folks will get a second instance here: flutter-intellij/flutter-idea/src/io/flutter/run/daemon/DevToolsService.java Lines 132 to 138 in 944aa02
The comment suggests this is internal only but I'm not sure if that's totally right as there are external folks using Bazel workspaces. (I think?) |
Doing further testing I was able to reproduce a spinner! 🎉 Luckily I had added some logging that confirmed I was spawning a second DevTools from the flutter plugin. To test the earlier hypothesis, I removed the spawning logic and saw no spinner but an empty property editor: ![]() The logs reveal the timing issue:
It occurs to me that while adding a conditional wait might solve the problem it could introduce another one if it required us to block the UI thread on tool window creation. Maybe we could rejigger the DevTools tool windows to subscribe to a service and get updated when the server is up? Relatedly, is there an existing way to restart DevTools from the IDE? How does that work with the toolbars? On the surface, it looks like they would remain attached to the defunct instance and need to be closed and reopend to get a fresh connection? @helin24: maybe you know? |
For anyone following along, another thing I'm noticing is that I most reliably get a spinner if the property editor is open when I start the IDE. If the inspector is active instead, the property editor is more likely to be happy when I switch to it. Logs from a session with the inspector active on open where I switch to the property editor:
|
A bit more logging suggests that the timing issue boils down to a sequence like this:
/fyi @helin24 @elliette who might have ideas about how we to best re-think tool window content initialization |
Successful load (remove .txt to load in Chrome DevTools):
successful_load.har.txt
@jwren @elliette
The text was updated successfully, but these errors were encountered: