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
[Bug]: setImmediate stops working randomly in v11.3.0+ after reloading the app #29261
Comments
I just managed to reproduce this in v11.3.0 after we bumped it in desktop/desktop#12279 No idea for how long the bug has been there, but it seems 11.4.0 made it much much easier to reproduce 🤔 |
I assume you're talking about calling |
Yes! In this case the problem presents in the renderer thread, in a callback from a I haven't tried if the same happens in the main process, but I can check if that helps. |
It would be great to check if this happens in 12.x or 13.x, there have been a couple of fixes in this area recently. |
Testing this on 12.x or 13.x is a bit more challenging than expected, since I can only reproduce this behavior in the GitHub Desktop app. In any case, I tested calling I'm gonna try and debug this a bit more 🤞 |
The main process and the renderer process have extremely different characteristics when it comes to calling Node functions like setImmediate, so I wouldn't take much heart from the fact that it works in the main process. |
@sergiou87 #28957 was merged into v11.4.5 and fixed some related issues - does this make a difference for your case? |
An update on this: even though I was 99.99% sure I ran into this bug, at least once, without reloading the app, @nornagon suggested this could be an issue only after reloading the app. Since then I've been trying to reproduce this problem without reloading the app and haven't been able to. So either I never saw this bug without reloading the app, or I reloaded the app and kept it open for a few days before I saw the bug (and at that point, I forgot I reloaded the app). The latter seems more probable 😅 Thanks to everyone who helped me, and sorry I wasted your time! 😢 I've updated the issue description with this new info. |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue. |
Preflight Checklist
Electron Version
11.3.0
What operating system are you using?
macOS
Operating System Version
macOS Big Sur 11.3.1 (20E241)
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
11.3.011.2.0Expected Behavior
setImmediate
still responds.Actual Behavior
I haven't managed to get this into a simple sample app. I will try, but wanted to share what happens in GitHub Desktop in case it's clear to someone what the problem is. If you want to reproduce it yourself, you'll need to use the latest beta.
Basically when I start the app, invoking
setImmediate
works perfectly. However, if I reload the app at some point (pressing Cmd+R from the Dev Tools) and then I start switching between apps, at some point, randomly,setImmediate
stops working. It's like the thread/runner/event loop is blocked.In the video below, which was recorded AFTER I reloaded the app, you see the following:
setImmediate
works at the beginning, showing the alert.setImmediate
doesn't work.setImmediate
command and I don't get an alert.electron-setimmediate-bug.mp4
Testcase Gist URL
No response
Additional Information
As you can see, I can't reproduce the issue 100% reliably. I'm quite sure it doesn't happen in 11.1.1, because I've used that one for quite a long time. However, I tested what you see in the video with 11.2.0
and 11.3.0and I couldn't reproduce it.EDIT: today (8-jun-2021) I managed to repro this behavior in 11.3.0, after 2 weeks using the app intensively. As of today, I'm not sure which version broke this, but seems like 11.4.0 makes it much much easier to reproduce it.
Looking at the release notes of v11.4.0, #27582 is the one that seems more suspicious to me.
I could reproduce it with 11.4.0, 11.4.4 and 11.4.7 (the latest version of v11), but I haven't tested other versions in between, nor anything out of v11 (like v10, v12 or v13).
I'll try to write a Fiddle that reproduces the issue
The text was updated successfully, but these errors were encountered: