-
Notifications
You must be signed in to change notification settings - Fork 287
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
ensure port is connected #2533
ensure port is connected #2533
Conversation
Thank you! We will run this version today and report back |
I wonder what that last error is. Are you using chrome or something via visual studio? |
@kdagnan I added some logging, can you test with this? |
i added the logging to https://github.com/patricklx/ember-inspector/tree/port-connect-logging i think this already makes sense to merge, a similar issue was reported on discord |
I think that the _ensureConnected change actually fixed the original issue, I just realized the only time I am having issues now are when stopped at a breakpoint in the browser. Inspector freezes up, but when breakpoints are all stepped through, it works again. Installed 4.9.1 and it had the same behavior although I could've sworn it worked previously. Thank you again for your help & quick fixes. |
let chromePort = this._chromePort; | ||
chromePort.postMessage({ appId: chrome.devtools.inspectedWindow.tabId }); | ||
|
||
chromePort.onMessage.addListener((...args) => { | ||
this._messageReceived(...args); | ||
}); | ||
|
||
chromePort.onDisconnect.addListener(() => { | ||
this._isConnected = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this this._isConnected
boolean? If we're going to call this._connect
onDisconnect
wouldn't that be sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't. fixed
fixes #2532
looks like service workers can be shutown after idle time... with manifest V3.
but it can be stopped any time, as it is not guaranteed.
also we reconnect immediately so that we can receive updates when some start coming in from ember_debug site
https://developer.chrome.com/docs/extensions/develop/concepts/service-workers/lifecycle#idle-shutdown
tested manually by stopping the service worker in chrome://serviceworker-internals/?devtools