Skip to content

fix(#8440): improve IRC auth error handling with retry mechanism#8546

Open
Pro0101-2b2fr wants to merge 1 commit into
CCBlueX:nextgenfrom
Pro0101-2b2fr:fix/irc-auth-error-handling
Open

fix(#8440): improve IRC auth error handling with retry mechanism#8546
Pro0101-2b2fr wants to merge 1 commit into
CCBlueX:nextgenfrom
Pro0101-2b2fr:fix/irc-auth-error-handling

Conversation

@Pro0101-2b2fr

@Pro0101-2b2fr Pro0101-2b2fr commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Might fix #8440 ? — LiquidChat authentication silently failed with "Not authenticated!" even for premium accounts.

Changes

AxochatClient.kt

  • Added logger.warn for InvalidCredentialsException (was completely silent before).
  • Added logger.error with full stacktrace for unexpected auth errors.

GlobalSettingsClientChat.kt

  • Retry mechanism: On auth failure, the client now retries requestMojangLogin() up to 3 times with exponential backoff (3s, 8s, 15s). This handles transient token expiration without user intervention.
  • User feedback: Only after all retries are exhausted, a clear chat message is shown explaining the issue and suggesting a game restart.
  • State management: authRetryCount is reset on successful login (LOGGED_IN state) and on session change (SessionEvent), so a fresh login attempt always starts clean.

Why retry works

Minecraft auth service (sessionService.joinServer) validates the current access token against Mojang servers. Tokens can expire mid-session but get refreshed by the launcher in the background. A retry after a few seconds often succeeds because:

  1. The launcher has refreshed the token by then.
  2. Mojang auth servers may have had a transient hiccup.

After 3 failures (~26s total), the token is genuinely invalid and user action is required.

Backoff schedule

Attempt Delay Rationale
1 3s Quick retry for transient network issues
2 8s Allow token refresh to propagate
3 15s Last chance before giving up

This PR was developed with AI assistance.

When Mojang authentication fails (e.g. expired session token), the client
now retries up to 3 times with exponential backoff (3s, 8s, 15s) before
showing a final error message. This handles transient auth failures
without requiring the user to manually restart.

Changes:
- Add logger.warn/error in AxochatClient for auth failures
- Add retry logic with backoff in GlobalSettingsClientChat
- Show actionable chat message only after all retries exhausted
- Reset retry counter on successful login or session change
@Pro0101-2b2fr Pro0101-2b2fr force-pushed the fix/irc-auth-error-handling branch from a24eea7 to 5f4e415 Compare June 22, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] IRC

1 participant