Fork
0
代码
介绍
代码
Issues
Pull Requests
流水线
Actions
讨论
Wiki
项目成员
分析
项目设置
Fork
0
bde9bde17c3edbb75d35dd1f1907e2bc9033344c
lobe-chat
/
apps
下载当前目录
G
GitHub
🐛 fix(desktop): add token refresh retry mechanism (
#10575
)
83fc2e8b
创建于
2025年12月3日
历史提交
文件
最后提交记录
最后更新时间
desktop
🐛 fix(desktop): add token refresh retry mechanism (#10575) * 🐛 fix(desktop): add token refresh retry mechanism - Add `async-retry` library for exponential backoff retry - Implement retry logic in RemoteServerConfigCtr.refreshAccessToken() - Retries up to 3 times with exponential backoff (1s, 2s, 4s) - Distinguishes between retryable (network) and non-retryable (invalid_grant) errors - Update AuthCtr to only clear tokens for non-retryable errors - Transient errors now preserve tokens for retry on next cycle - Add isNonRetryableError() helper method This fixes the issue where temporary network problems would cause users to be logged out and require re-authorization. Closes LOBE-1368 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * update * 🐛 fix: treat deterministic failures as non-retryable errors Add deterministic failures to non-retryable error list: - 'No refresh token available' - refresh token missing from storage - 'Remote server is not active or configured' - config invalid/disabled - 'Missing tokens in refresh response' - server returned incomplete response These permanent failures now trigger immediate token clearing and authorizationRequired broadcast instead of infinite retry loop. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * 📝 docs: clarify issue status workflow - use "In Review" after PR creation - Change workflow to set status to "In Review" when PR is created - "Done" status should only be set after PR is merged - Add note about Linear-GitHub integration for auto status update 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * 🐛 fix: add grace period for consumed RefreshToken When rotateRefreshToken is enabled, the old refresh token is consumed when a new one is issued. If the client fails to receive/save the new token (network issues, crashes), the login state is lost. This adds a 3-minute grace period allowing consumed refresh tokens to be reused, giving clients a chance to retry the refresh operation. Changes: - Add REFRESH_TOKEN_GRACE_PERIOD_SECONDS constant (180s) - Modify find() to allow RefreshToken reuse within grace period - Add unit tests for grace period behavior Closes LOBE-1369 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * 📝 style: translate adapter test descriptions to English 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
5 个月前