-
Notifications
You must be signed in to change notification settings - Fork 47k
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: respect shutdown in agent #31049
base: main
Are you sure you want to change the base?
Fix: respect shutdown in agent #31049
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
The react/packages/react-devtools-shared/src/bridge.js Lines 365 to 366 in e740d4b
But I don't think that the Great catch, this can definitely be the root cause, but I guess we just need to somehow test this. |
In any case, with the application frame reload, these But I am not sure that this can actually happen, need to double-check the order between |
I guess you can try reverting your changes in #31024 and see what happens with these changes. |
) Based on #31049, credits to @EdmondChuiHW. What is happening here: 1. Once Agent is destroyed, unsubscribe own listeners and bridge listeners. 2. [Browser extension only] Once Agent is destroyed, unsubscribe listeners from BackendManager. 3. [Browser extension only] I've discovered that `backendManager.js` content script can get injected multiple times by the browser. When Frontend is initializing, it will create Store first, and then execute a content script for bootstraping backend manager. If Frontend was destroyed somewhere between these 2 steps, Backend won't be notified, because it is not initialized yet, so it will not unsubscribe listeners correctly. We might end up duplicating listeners, and the next time Frontend is launched, it will report an issues "Cannot add / remove node ...", because same operations are emitted twice. To reproduce 3 you can do the following: 1. Click reload-to-profile 2. Right after when both app and Chrome DevTools panel are reloaded, close Chrome DevTools. 3. Open Chrome DevTools again, open Profiler panel and observe "Cannot add / remove node ..." error in the UI.
Summary
Listeners were not unsubscribed to upon shutdown. Discussed in #31024.
How did you test this change?
Test E2E in D63233256