[PR #4770] [MERGED] Fix Stale User Session with Proper fetch Error Handling #4763

Closed
opened 2026-02-22 18:36:29 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4770
Author: @angelplusultra
Created: 12/11/2025
Status: Merged
Merged: 12/12/2025
Merged by: @timothycarambat

Base: masterHead: bug-user-session-stale


📝 Commits (10+)

  • 2f12f7f add refresh user functionality
  • 7ce7e93 prettier
  • 6e78f10 add eslint disable comment for exhaustive-deps warning in AuthContext to stop nagging about navigate func
  • 8fe3e87 remove unused imports and fix typo
  • 8f52ada handle unsafe parse of undefined for in-session user deleted
  • 1a43710 Merge branch 'master' into bug-user-session-stale
  • 9e26403 Refactor refreshUser function to handle errors and return structured response. Update AuthProvider to manage user data based on success status.
  • dd8f726 Remove console error logging from promise catch in System model for cleaner error handling.
  • dc8403b change status from 404 to 400 and valid to success
  • e20ecc6 Refactor error handling in AuthProvider's refreshUser logic to remove redundant catch block and streamline user session management on failure.

📊 Changes

4 files changed (+107 additions, -3 deletions)

View changed files

📝 .github/workflows/dev-build.yaml (+1 -1)
📝 frontend/src/AuthContext.jsx (+44 -2)
📝 frontend/src/models/system.js (+16 -0)
📝 server/endpoints/system.js (+46 -0)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

What is in this change?

This PR introduces the core functionality in #4751 and adds better error handling

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 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/Mintplex-Labs/anything-llm/pull/4770 **Author:** [@angelplusultra](https://github.com/angelplusultra) **Created:** 12/11/2025 **Status:** ✅ Merged **Merged:** 12/12/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `bug-user-session-stale` --- ### 📝 Commits (10+) - [`2f12f7f`](https://github.com/Mintplex-Labs/anything-llm/commit/2f12f7f929f936e4096cbe38c717e9dfbf928c31) add refresh user functionality - [`7ce7e93`](https://github.com/Mintplex-Labs/anything-llm/commit/7ce7e9362b1ad2ff96d90b900291993fbbc08cc5) prettier - [`6e78f10`](https://github.com/Mintplex-Labs/anything-llm/commit/6e78f10252a119408bc78cd420b5e2b007dfba5b) add eslint disable comment for exhaustive-deps warning in AuthContext to stop nagging about navigate func - [`8fe3e87`](https://github.com/Mintplex-Labs/anything-llm/commit/8fe3e874f553cc0918923671c086b905dec2955c) remove unused imports and fix typo - [`8f52ada`](https://github.com/Mintplex-Labs/anything-llm/commit/8f52ada8279615353a84fe13873b7164203b6988) handle unsafe parse of undefined for in-session user deleted - [`1a43710`](https://github.com/Mintplex-Labs/anything-llm/commit/1a43710bb8ca390396ec61c5334e933e49498cf7) Merge branch 'master' into bug-user-session-stale - [`9e26403`](https://github.com/Mintplex-Labs/anything-llm/commit/9e264039cd12e73bc201007b16416cdaec0835da) Refactor refreshUser function to handle errors and return structured response. Update AuthProvider to manage user data based on success status. - [`dd8f726`](https://github.com/Mintplex-Labs/anything-llm/commit/dd8f726bdee7a0587ac7da1f9b85cd73c91df7cf) Remove console error logging from promise catch in System model for cleaner error handling. - [`dc8403b`](https://github.com/Mintplex-Labs/anything-llm/commit/dc8403b883cea23a89700c9ee15c6689e8314e85) change status from 404 to 400 and valid to success - [`e20ecc6`](https://github.com/Mintplex-Labs/anything-llm/commit/e20ecc6aea5cc05468d12ceed0ae89bb01acb5de) Refactor error handling in AuthProvider's refreshUser logic to remove redundant catch block and streamline user session management on failure. ### 📊 Changes **4 files changed** (+107 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/dev-build.yaml` (+1 -1) 📝 `frontend/src/AuthContext.jsx` (+44 -2) 📝 `frontend/src/models/system.js` (+16 -0) 📝 `server/endpoints/system.js` (+46 -0) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat - [x] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> This PR introduces the core functionality in #4751 and adds better error handling ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:29 -05:00
yindo closed this issue 2026-02-22 18:36:29 -05:00
yindo changed title from [PR #4770] Fix Stale User Session with Proper `fetch` Error Handling to [PR #4770] [MERGED] Fix Stale User Session with Proper `fetch` Error Handling 2026-06-05 15:20:15 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4763