mirror of
https://github.com/moghtech/komodo.git
synced 2026-03-09 07:13:36 -05:00
[PR #618] [MERGED] [PR] Fix for the spamming /auth/GetUser when unexpected logout occured #756
Reference in New Issue
Block a user
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?
📋 Pull Request Information
Original PR: https://github.com/moghtech/komodo/pull/618
Author: @huzky-v
Created: 6/23/2025
Status: ✅ Merged
Merged: 6/24/2025
Merged by: @mbecker20
Base:
1.18.4← Head:fix-unexpected-logout-request-spam📝 Commits (1)
6af9a5bAttempt fix: Use reset instead of invalidate to avoid caching📊 Changes
1 file changed (+9 additions, -2 deletions)
View changed files
📝
frontend/src/lib/hooks.ts(+9 -2)📄 Description
Description
Environment:
Komodo core version: 1.18.3
Browser: Chrome / Safari
The case happens when I put the komodo browser idle long enough (e.g. put a sleep on my mac and keep my browser open) , the token timed out.
I have seen the network and cpu usage goes up.
After checking the browser console, I found that
/auth/GetUserare spammed to the Komodo core server.Here are the reproducible steps:
komodo-auth-tokenfrom Local Storage, forcing them to logout, and wait for approx. 10s to redirect back to login page/auth/GetUserrequests are getting spammed to the Komodo core server, spiking the CPU and network usage.And after extensive checking, found that the
qc.invalidateQueriesdoes not return updateduserDataafter the invalidation. (Checked the data shows that thequery.datastill have the user data, which the new response on/auth/GetUsersis a HTTP 500 error)Later found that the
qc.resetQuerieswill stop the spam, but since I do no exp on React, I am not sure if it is best practice or not breaking other imports usinguseUser, breaking existing logics etc.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.