Open silverwind opened 1 year ago
I think this issue exists already, the original even has a bounty if I remember correctly.
I couldn't find it earlier. If it exists, I'll add my comment there instead.
Ping @kdumontnu as I believe he was the one who put the bounty on it
This is the one with the bounty but we talk about a general refreshing.
We need a pub/sub abstract layer to replace modules/eventsource
as backend of the websocket server side.
For distributed gitea setups a pub/sub mechanism is indeed necessary so that events originating on gitea instance 1 can propagate to clients connected on instance 2. Often this is done through redis, which would then make it a hard dependency, at least for distributed setups.
For distributed gitea setups a pub/sub mechanism is indeed necessary so that events originating on gitea instance 1 can propagate to clients connected on instance 2. Often this is done through redis, which would then make it a hard dependency, at least for distributed setups.
For single and default configuration, we can have a memory pub/sub implementation based on golang channel and a disk implementation.
Feature Description
Currently we have Server-Sent-Events aka.
EventSource
for a few things but it's too unreliable because browser enforce a 6 connection limit per browser window and I think our implementation also has a number of unresolved bugs.We should therefore switch EventSource to Websockets. From what I gather, suitable modules are:
For the frontend side, I recommend SharedWorker similar to this that can communicate "events" that are simple JSON messages to all open tabs. Could initially also be done on main thread because workers are a very hard to debug in browsers.