[PR #618] [MERGED] [PR] Fix for the spamming /auth/GetUser when unexpected logout occured #756

Closed
opened 2025-10-31 15:20:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 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.4Head: fix-unexpected-logout-request-spam


📝 Commits (1)

  • 6af9a5b Attempt 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/GetUser are spammed to the Komodo core server.
Here are the reproducible steps:

  1. Login Komodo
  2. Deleting komodo-auth-token from Local Storage, forcing them to logout, and wait for approx. 10s to redirect back to login page
  3. The /auth/GetUser requests are getting spammed to the Komodo core server, spiking the CPU and network usage.
    spam

And after extensive checking, found that the qc.invalidateQueries does not return updated userData after the invalidation. (Checked the data shows that the query.data still have the user data, which the new response on /auth/GetUsers is a HTTP 500 error)

Later found that the qc.resetQueries will 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 using useUser, breaking existing logics etc.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/moghtech/komodo/pull/618 **Author:** [@huzky-v](https://github.com/huzky-v) **Created:** 6/23/2025 **Status:** ✅ Merged **Merged:** 6/24/2025 **Merged by:** [@mbecker20](https://github.com/mbecker20) **Base:** `1.18.4` ← **Head:** `fix-unexpected-logout-request-spam` --- ### 📝 Commits (1) - [`6af9a5b`](https://github.com/moghtech/komodo/commit/6af9a5bd8ebe91c41698ea153d6e79ee97f1d213) Attempt fix: Use reset instead of invalidate to avoid caching ### 📊 Changes **1 file changed** (+9 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/lib/hooks.ts` (+9 -2) </details> ### 📄 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/GetUser` are spammed to the Komodo core server. Here are the reproducible steps: 1. Login Komodo 2. Deleting `komodo-auth-token` from Local Storage, forcing them to logout, and wait for approx. 10s to redirect back to login page 3. The `/auth/GetUser` requests are getting spammed to the Komodo core server, spiking the CPU and network usage. ![spam](https://github.com/user-attachments/assets/e40a27bd-dd71-4d2e-a0a9-faf92b3448dd) And after extensive checking, found that the `qc.invalidateQueries` does not return updated `userData` after the invalidation. (Checked the data shows that the `query.data` still have the user data, which the new response on `/auth/GetUsers` is a HTTP 500 error) Later found that the `qc.resetQueries` will 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 using `useUser`, breaking existing logics etc. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-10-31 15:20:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#756