feat: handle socket reconnection after server restart#861
feat: handle socket reconnection after server restart#861
Conversation
Add connect_error handler in SocketManager that re-registers users when the server rejects connection with "User not found" error. This happens when the server restarts and Redis data is cleared - the client's JWT token is still valid but the user no longer exists in Redis. The handler: - Detects "User not found" errors during reconnection - Re-calls api.login() to re-register the user in Redis - Updates the JWT token so subsequent reconnect attempts succeed Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #861 +/- ##
==========================================
+ Coverage 80.01% 80.12% +0.10%
==========================================
Files 165 166 +1
Lines 20131 20217 +86
==========================================
+ Hits 16108 16198 +90
+ Misses 4023 4019 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
TODO: fix / check tests
Add connect_error handler in SocketManager that re-registers users when the server rejects connection with "User not found" error. This happens when the server restarts and Redis data is cleared - the client's JWT token is still valid but the user no longer exists in Redis.
The handler:
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com