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

After recent upgrade, GhostText disconnects from editor after 30 seconds #317

Open
nsc-kronberg opened this issue Jul 1, 2024 · 13 comments · Fixed by #318 or #324
Open

After recent upgrade, GhostText disconnects from editor after 30 seconds #317

nsc-kronberg opened this issue Jul 1, 2024 · 13 comments · Fixed by #318 or #324
Assignees

Comments

@nsc-kronberg
Copy link

nsc-kronberg commented Jul 1, 2024

Description and repro

Sometime in the last few days GhostText stopped working properly on both my Linux computers. I suspect it has to do with the recent GhostText update (Firefox says "Last Updated June 30, 2024" for GhostText on about:addons).

The content of the text area appears in my editor (Emacs using https://github.com/alpha22jp/atomic-chrome), and I can edit it, and if I close the editor buffer within 30 seconds everything works normally.

But almost exactly 30 seconds after I click the GhostText button in Firefox, the editor buffer closes (just as if I closed it manually), but GhostText in Firefox appears to still be active (green tickmark on GhostText icon) so I cannot easily enable the editing again without reloading the web page.

The 30s seems to be if the editor is idle. If I type in the editor more or less constantly, I can see the edits in the Firefox text area, and the connection lives for a little longer, around 55 seconds.

This could of course be an Emacs problem, but I tried snooping on the Websocket traffic between Firefox and Emacs using Wireshark, and I can see that Firefox/GhostText sends a "WebSocket Connection Close" packet exactly when Emacs closes the buffer.

I realize Emacs is not officially supported and I have not tested in Chrome, but it seems like a clear regression in GhostText (or maybe something triggered by a recent Firefox update)

Browser(s) tried

Firefox

Editor(s) tried

Emacs

@fregante
Copy link
Owner

fregante commented Jul 1, 2024

This is a limitation of the new Manifest v3 that Google has been forcing on us. I'll check if I can send a dummy message every 10 seconds to keep the connection alive.

@fregante
Copy link
Owner

fregante commented Jul 6, 2024

An update is out, but you need Firefox 128+ now since v24.7.1

Wait until July 9th for its release or download the beta now:

https://www.mozilla.org/en-US/firefox/channel/desktop/#beta

@dhull
Copy link

dhull commented Jul 29, 2024

I recently noticed the same problem described in this issue, that the connection between GhostText and my editor (Emacs, with atomic-chrome 20230304.112) has been dying after 30 seconds of inactivity. I am using the latest versions of Firefox and GhostText.

Firefox: 128.0.3
GhostText: 24.7.6

I see that the background.js file in my extension download has the new "ping" code, but I don't see the "ping" logged in my browser's console. (I don't see the "will open socket" message either, so maybe the messages are being logged somewhere else? The only messages I'm seeing in the browser console are "GhostText: Click on the desired element to activate it." and "GhostText: Connected! You can switch to your editor".)

I installed the older GhostText 24.6.7 from https://addons.mozilla.org/firefox/downloads/file/4299538/ghosttext-24.6.7.xpi, which seems to be the last release before you switched to Manifest v3, and it did not have the connection issue.

@erwin
Copy link

erwin commented Aug 1, 2024

Downgrading to v24.6.7 as @dhull suggested worked great for me!

So awesome! Life changing to have such easy access to your favorite editor!

I was not able to get the current version of GhostText working on the latest Firefox Beta, outlined the details on this comment.

#318 (comment)

NOTE: Be sure to DISABLE UPDATES so that you don't have to re-install...

image

@newsch
Copy link
Contributor

newsch commented Aug 9, 2024

Same issue on Firefox 129.0 on Ubuntu and Ghosttext 24.7.6. Downgrading to 24.6.7 fixed it.

@dhull You can see an extension's logs/network connections in Firefox by going to about:debugging#/runtime/this-firefox and clicking on the "Inspect" button for the installed extension.

It looks like the "ping" is sent from the background js worker to the extension js (through the "port"), not over the websocket from the extension to the server.

FWIW I tried sending {ping:true} text messages from the server over websocket every 5 seconds and it still closed.

@fregante
Copy link
Owner

When v24.8.10 is available for download, please test it out and let me know. For me it worked correctly in both browsers

@dhull
Copy link

dhull commented Aug 12, 2024

When v24.8.10 is available for download, please test it out and let me know. For me it worked correctly in both browsers

Thanks! The new GhostText version v24.8.10 works for me in Firefox 129.0. The browser's connection to Emacs does not close after 30 seconds.

@Stebalien
Copy link

@fregante works great! thanks!

@zynim-cschmidt
Copy link

This is working on Firefox now as discussed above, but it has not been working in Chrome the last week. It loses the connection somewhat randomly between 1 and 5 minutes. Thank you for all your work on this!

@fregante
Copy link
Owner

Do you mean it was working but stopped with the latest version?

@zynim-cschmidt
Copy link

Do you mean it was working but stopped with the latest version?

Yes, correct

@fregante fregante reopened this Aug 20, 2024
@fregante fregante self-assigned this Aug 20, 2024
@Andrew15-5
Copy link

When v24.8.10 is available for download, please test it out and let me know.

I noticed this a few months ago and thought that maybe I broke something. Instead, I just continue editing the text and then pasting it into unsynced tab through clipboard. Which kinda defeats the purpose. So I had less and less desire in using this plugin because of the issue. But today I finally tried searching if anyone else got the same problem, and it's so calming that I'm not the only one.

Anyway, I updated Firefox (130.0) and the extension (24.8.10) to the latest version and let it sit for 5+ minutes. It didn't disconnect! Hurray!

P.S. I use Neovim, btw (with this patch on top of subnut/nvim-ghost.nvim@4ce472f).

@nsc-kronberg
Copy link
Author

nsc-kronberg commented Sep 23, 2024

When v24.8.10 is available for download, please test it out and let me know. For me it worked correctly in both browsers

v24.8.10 solved the problem for me (Firefox 130.0.1, Emacs atomic-chrome).

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