Closed moritz closed 3 years ago
After writing my very own server code I can with absolute certainly confirm that GhostText does in fact spawn exponentially more editors on every click.
I've watched the traffic in WireShark and can confirm that on first click:
GET /
to localhost:4001When the editor closes the WebSocket is closed and GhostText sends a user notification that it has disconnected.
On second click:
GET /
to localhost:4001GET /
to localhost:4001Repeat this again and we will double that! This seems to be a exponential problem. I would love to know just why a WebSocket close connection is not cleaning up rouge event handlers?
This is caused by the script injection in the extension, every time you click the button it adds a listener, so when you focus the field it will fire all the listeners and each listener will open a connection. Solution: refresh the browser tab
Are you suggesting that the normal operation involves refreshing the browser tab every time you make a change? I'm willing to guess that we have a fundamental misunderstanding of how the protocol functions.
According to the only documentation so far multiple button presses does not suggest multiple listeners.
When a websocket is complete is the server meant to keep it open? What message
is sent to say it is done so the websocket closes? If the websockets are not meant to close how are multiple text areas differentiated?
It's a bug.
I see the same issue. Is it possible this could be resolved?
Try this out! https://github.com/GhostText/GhostText/pull/122
I have tried. It looks much better. Thank you.
I'm using GhostText 17.10.25.1400 with Firefox 57 on Ubuntu 17.04 together with https://github.com/falstro/ghost-text-vim
When I first click on the GhostText icon, it opens one gvim window. When I save the text and close the editor, and then click on the GhostText icon a second time, it opens two gvim windows, one empty, one with the text from that text area that is in focus. Each time I repeat this, I get one more empty gvim window (so on the 5th run I get 4 empty and 1 normal gvim windows).
There is an issue in the vim plugin repo at falstro/ghost-text-vim#3 which claims this is a problem in GhostText, not in the vim plugin.