Skip to content

fix: 🐛 more descriptive error for "blocked user"#190

Merged
highesttt merged 2 commits into
mainfrom
highest/plat-37571
Jun 17, 2026
Merged

fix: 🐛 more descriptive error for "blocked user"#190
highesttt merged 2 commits into
mainfrom
highest/plat-37571

Conversation

@highesttt

Copy link
Copy Markdown
Collaborator

No description provided.

@indent

indent Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor
PR Summary

Improves login-error UX so LINE "blocked user" responses surface as the existing "Too many login attempts" lockout message instead of an opaque raw error. Also extends the login-error JSON parser to fall back to data.message when data.reason is empty.

  • loginErrorInstructions maps either the canonical Too many login attempts reason or a "blocked user" message to a new loginTooManyAttemptsInstructions string.
  • New constants loginTooManyAttemptsReason / loginTooManyAttemptsInstructions (declared at the top of the file).
  • loginErrorReason now parses payload.Data.Message alongside Reason, falls back to Message when Reason is empty, and returns loginTooManyAttemptsReason when the parsed reason is exactly "blocked user".
  • New helper isBlockedUserLoginError doing a trimmed case-insensitive equality check.

Issues

1 potential issue found:

  • Nit: the new Data.Message fallback in loginErrorReason changes user-visible strings for non-blocked-user errors too — previously empty-reason responses produced Login failed: <raw err>, now they may display Could not log in to LINE: RESPONSE_ERROR. Worth confirming this is the intended UX for the broader set of LINE error payloads, not just the blocked-user case. → Autofix
2 issues already resolved
  • Nit: loginTooManyAttemptsReason / loginTooManyAttemptsInstructions are declared in a const block sandwiched between loginErrorInstructions and loginErrorReason. Move them to the top of the file (or beside other package-level decls) to match Go conventions and the rest of this file's layout. (fixed by commit f1d8bee)
  • Latent: after loginErrorReason successfully parses a meaningful Data.Reason/Data.Message, it still re-checks isBlockedUserLoginError(msg) on the full error string — so any future LINE error whose payload happens to embed "blocked user" anywhere will be overridden with the lockout reason instead of its real reason. Today no other login error contains that phrase; trigger is LINE adding such a message. (fixed by commit f1d8bee)

CI Checks

Waiting for CI checks...


⚡ Autofix All Issues

@linear-code

linear-code Bot commented Jun 17, 2026

Copy link
Copy Markdown

PLAT-37571

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7b754445-86e4-481c-88fc-06ce6ce92057

📥 Commits

Reviewing files that changed from the base of the PR and between 593cd2d and f1d8bee.

📒 Files selected for processing (1)
  • pkg/connector/connector.go

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved login error handling to provide clearer feedback when too many failed login attempts occur or when accounts are blocked. Enhanced error detection now properly identifies and communicates authentication issues to help users resolve access problems more effectively.

Walkthrough

Two constants are added for the "too many login attempts" error reason and its user instructions. loginErrorInstructions is updated to match both the new constant and "blocked user" errors case-insensitively. loginErrorReason is reworked to parse structured JSON data.reason/data.message fields and normalize "blocked user" payloads to the new constant via a new isBlockedUserLoginError helper.

Changes

Login Error Classification and Messaging

Layer / File(s) Summary
Constants, loginErrorInstructions, and loginErrorReason expansion
pkg/connector/connector.go
Adds two constants for the canonical too-many-login-attempts reason and instructions. loginErrorInstructions extended with case-insensitive matching for both. loginErrorReason reworked to parse data.reason/data.message from JSON, preferring reason, with a new isBlockedUserLoginError helper that maps blocked-user payloads to the new constant.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • beeper/line#187: Modifies the same loginErrorStep error-handling path in pkg/connector/connector.go, refactoring how user-facing instructions are derived from LINE server error content.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch highest/plat-37571

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread pkg/connector/connector.go Outdated
Comment thread pkg/connector/connector.go Outdated
@highesttt highesttt merged commit 3fb3964 into main Jun 17, 2026
9 of 10 checks passed
@highesttt highesttt deleted the highest/plat-37571 branch June 17, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant