Skip to content
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

Firefox console shows "Attempt to postMessage on disconnected port" from Apollo extension #1007

Closed
swrobel opened this issue Mar 22, 2023 · 5 comments

Comments

@swrobel
Copy link

swrobel commented Mar 22, 2023

Intended outcome:
No extraneous errors are shown in Firefox browser console

Actual outcome:
Every browser tab for a site that doesn't use Apollo (ex: github) shows this in the console:

Error: Attempt to postMessage on disconnected port [tab.js:1:3247](moz-extension://8d7e5e49-00fa-624f-b1ba-d10fd33b0a05/tab.js)
    sendPortMessage resource://gre/modules/ExtensionChild.jsm:312

How to reproduce the issue:

Load any page that doesn't use Apollo (this page will do) in Firefox with the Apollo Client Devtools extension installed

Desktop (please complete the following information):

  • OS: macOS 13.2.1
  • Browser: Firefox
  • Browser version: 111.0.1
  • Extension version 4.1.4
@jerelmiller jerelmiller added 🔍 investigate 🏓 awaiting-team-response requires input from the apollo team labels Mar 23, 2023
@phryneas
Copy link
Member

Thank you for the bug report, I can reproduce this.

Note for further reproduction: only happens when reloading the page while the DevTools are open.

@abarreir
Copy link

I've further investigated this issue, and the extension panel stops working after some idle time 100% of the time. A similar issue happened to vuejs devtools https://github.com/vuejs/devtools/issues/1974, making the background script persistent in the manifest file fixed the issue.

I've tested the fix locally and can confirm the content script stops losing connection to the background script. Please note that the issue is not reproducible when inspecting the background script with firefox devtools, since this prevents the script from going idle :

bg-script-devtool-msg

@jerelmiller
Copy link
Member

Hey all 👋

I'd love to revisit this and see if this is still an issue. We introduced a change some time ago that will automatically reconnect ports when they disconnect which should help when the background script goes idle due to inactivity. This should be available in v4.14.2 or later.

Let me know if you're still seeing this issue, otherwise I'll plan to close this 🙂

@swrobel
Copy link
Author

swrobel commented Jul 12, 2024

Not seeing this anymore. Thanks @jerelmiller!!!

@swrobel swrobel closed this as completed Jul 12, 2024
Copy link
Contributor

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants