Skip to content

Improve logout from worker #30775

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

Merged
merged 3 commits into from
Apr 30, 2024
Merged

Improve logout from worker #30775

merged 3 commits into from
Apr 30, 2024

Conversation

wxiaoguang
Copy link
Contributor

A quick fix for #30756

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 30, 2024
@wxiaoguang wxiaoguang added type/bug backport/v1.22 This PR should be backported to Gitea 1.22 and removed modifies/js labels Apr 30, 2024
@wxiaoguang wxiaoguang linked an issue Apr 30, 2024 that may be closed by this pull request
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 30, 2024
@silverwind
Copy link
Member

It does appear to at least fix the issue:

image

@silverwind
Copy link
Member

What I don't quite understand: Why do we have this logout SSE event? What's the point?

@silverwind
Copy link
Member

silverwind commented Apr 30, 2024

Ah, so it's a multi-tab logout feature, ok. It does seem incorrect to listen for the event twice in both SSE subscriptions, but I guess this whole SSE code is very badly designed and needs a replacement, ideally websocket.

@silverwind
Copy link
Member

Can confirm it works. Logged out on tab 1, 5 seconds later tab 2 logged out. Maybe the delay is a bit much though.

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Apr 30, 2024

Can confirm it works. Logged out on tab 1, 5 seconds later tab 2 logged out. Maybe the delay is a bit much though.

It isn't much. Even if there is no logout from the worker, the user is indeed logged out, any new click will just request the page without signed-in account.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 30, 2024
@wxiaoguang wxiaoguang enabled auto-merge (squash) April 30, 2024 15:09
@wxiaoguang wxiaoguang merged commit a988237 into go-gitea:main Apr 30, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.23.0 milestone Apr 30, 2024
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Apr 30, 2024
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Apr 30, 2024
@wxiaoguang wxiaoguang deleted the fix-logout branch April 30, 2024 15:54
wxiaoguang added a commit that referenced this pull request Apr 30, 2024
Backport #30775 by wxiaoguang

A quick fix for #30756

Co-authored-by: wxiaoguang <[email protected]>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created backport/v1.22 This PR should be backported to Gitea 1.22 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/js type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logout doesn't work sometimes
5 participants