Be notified in real-time on any activity (for instance connection, cursor move, typing...) #3
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This would enable us to backup Overleaf content without regular
git pull
, see OC3Kcrontab
.Related to #11, Overleaf_history_exporter and Improve_websites_thanks_to_open_source/issues/770.
+72
Be notified in real-time on any activity (for instance cursor move, typing...)to Be notified in real-time on any activity (for instance connection, cursor move, typing...)DuckDuckGo and Google search Overleaf WebSocket.
Most results seem about hosting our own instance.
https://www.overleaf.com/socket.io/1/websocket/
first part changes everytime. Same for https://www.overleaf.com/socket.io/1/ and https://www.overleaf.com/socket.io/1/uzgxahft/
uzgxahft
being a random string I generated.There is no further request on Firefox when loading this webpage.
Should investigate these keywords. Well these seem to be old technologies except
websocket
.Let us read Wikipedia: WebSocket (1265617417). I quite completely read it.
Related to Benjamin-Loison/Contracts-management-website/issues/1.
Output:
DuckDuckGo search
"Protocol "wss" not supported or disabled in libcurl"
.The Stack Overflow answer 47861907:
Shell:
Shell:
Shell:
Shell:
Shell:
Bash script:
https://socket.io
socket.io
so it won't help much it seems.
https://socket.io/docs/v4/client-api/ may help.
Output:
DuckDuckGo search socket.io Python client.
https://pypi.org/project/python-socketio/
python-socketio has 4.1 k stars and last commit was 3 days ago.
Source: python-socketio/blob/781dc9a0305f6a795a0467ebc795f4b765084a0d/README.md#version-compatibility
https://python-socketio.readthedocs.io/en/stable/client.html
Output:
Python script:
Output:
same if use
https://
.DuckDuckGo and Google search Python Overleaf client.
pyoverleaf does not seem helpful.
https://www.overleaf.com/socket.io/
Welcome to socket.io.
https://plmlatex.math.cnrs.fr/project let see when and who did last edit.
May help #21.
The Stack Overflow answer 4152986 helps to add some logs.
notifyOnNewOverleafActivity.py.log
:Output:
So it seems to have broke after 8 minutes and 41 seconds.
Note that in theory there is no need to do anything as I just read the network of a relatively regular web-browser.
Check if no response since 50 seconds seems to be a good way to be notified when the WebSocket does not work anymore.
Alternatively should check if after the same amount of time face again this issue.
Output:
Would be interesting to see the window to see if there is any prompt.
Note that my approach may not be stable if the server is not stable, as a regular user may see a prompt, possibly with a button, or just reload the webpage.
Python script:
Output:
works as wanted.
Benjamin_Loison/playwright/issues/3 would help.
Output:
Output:
Output:
does not return anything.
An alternative would to schedule a notification function and abort it and start a new one when receive a heartbeat.
Output:
Now using:
Output:
global lastTime
was missing inserver_message_handler
.Output:
It seems correct as I restarted yesterday OverClock3000.
Next ping was expected at 2025-10-19 18:12:22.633351 which is quite exactly 24 hours after.
I am a bit surprised as I had the feeling that it was previously running for longer.
Benjamin-Loison/cpython/issues/29 would help, as the script is still running...
The 24 hours duration is not due to
page.wait_for_timeout
, but this Python statement is maybe involved in not stopping the script.I restarted the script to see if again face the issue after 24 hours.
I forgot to save the simplified script reproducing the non stopping behavior.
To be notified when someone leaves, as if do not write continuously can't know.
As possibly not multiple persons connected, just knowing that someone left if already nice.
People already connected when the script starts are sent as
last_updated_at
, see #issuecomment-4363.args
matchesid
, see #issuecomment-4343. Same if already connected withclient_id
.Note that such id changes from a connection to the other for the same authenticated user.
Could maintain a
dict
to leverage the associated identity.For the initialization:
Output:
Could merge
{first,last}_name
at initializion to havename
if connected later.Can first rely on
email
.Let us consider that Benjamin-Loison/matrix-commander/issues/16 may take multiple seconds and people may leave faster, as may have concurrency of him coming back for instance, well it would be using different ids.
So let us prefer keeping for too long memory content, but notify faster.
Note that if the person being connected when the script starts is
DO_NOT_NOTIFY_ON_EMAIL
, then it is not an issue.