Skip to content

Websocket for UI interactive refreshing #25661

@silverwind

Description

@silverwind
Member

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.

Activity

added
type/proposalThe new feature has not been accepted yet but needs to be discussed first.
type/featureCompletely new functionality. Can only be merged if feature freeze is not active.
topic/uiChange the appearance of the Gitea UI
on Jul 3, 2023
delvh

delvh commented on Jul 3, 2023

@delvh
Member

I think this issue exists already, the original even has a bounty if I remember correctly.

silverwind

silverwind commented on Jul 4, 2023

@silverwind
MemberAuthor

I couldn't find it earlier. If it exists, I'll add my comment there instead.

techknowlogick

techknowlogick commented on Jul 4, 2023

@techknowlogick
Member

Ping @kdumontnu as I believe he was the one who put the bounty on it

KN4CK3R

KN4CK3R commented on Jul 4, 2023

@KN4CK3R
Member

This is the one with the bounty but we talk about a general refreshing.

lunny

lunny commented on Jul 4, 2023

@lunny
Member

We need a pub/sub abstract layer to replace modules/eventsource as backend of the websocket server side.

silverwind

silverwind commented on Jul 4, 2023

@silverwind
MemberAuthor

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.

lunny

lunny commented on Jul 4, 2023

@lunny
Member

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.

anbraten

anbraten commented on Jan 16, 2024

@anbraten
Contributor

linking #2287

karanysingh

karanysingh commented on Apr 9, 2025

@karanysingh

Is this still open?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/uiChange the appearance of the Gitea UItype/featureCompletely new functionality. Can only be merged if feature freeze is not active.type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lunny@silverwind@techknowlogick@KN4CK3R@anbraten

        Issue actions

          Websocket for UI interactive refreshing · Issue #25661 · go-gitea/gitea