Skip to content

fix Expired github PAt error - #415

Open
Prince-ES wants to merge 1 commit into
AOSSIE-Org:mainfrom
Prince-ES:fix/expired-github-pat-auth-warning
Open

Prince-ES wants to merge 1 commit into
AOSSIE-Org:mainfrom
Prince-ES:fix/expired-github-pat-auth-warning

Conversation

@Prince-ES

@Prince-ES Prince-ES commented Oct 26, 2026 •

Copy link
Copy Markdown

Addressed Issues:

Fixes #404

Screenshots/Recordings:

before:-
OrgExplorer HTTP_401 Dashboard

after:-
image

Additional Notes:

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

  • Bug Fixes
    • Improved error messaging for authorization failures, advising users to check or replace their GitHub token in Settings.

@github-actions github-actions Bot added bug Something isn't working frontend Frontend changes javascript JavaScript/TypeScript changes labels Oct 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between b396d1b and c7a4e23.

Files selected for processing: 1
  • src/context/AppContext.jsx

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The organization search now displays a dedicated message when it receives an HTTP_401 error. Rate-limit errors retain their existing token-dependent messages, and other errors continue to display their error message.

Changes

Organization search error handling

Layer / File(s) Summary
PAT authentication error message
src/context/AppContext.jsx
When explore receives an HTTP_401 error, it displays a message that the GitHub PAT may be expired or invalid and should be checked or replaced in Settings. Rate-limit errors retain their existing messages. Other errors display their error message. Error paths return false before the existing finally cleanup.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: High

Suggested labels: Typescript Lang

Suggested reviewers: ri1tik

Merge Risk: Minimal · up to c7a4e

Organization searches now give users a clearer warning for invalid GitHub credentials. No merge-blocking issue is established.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: fixing the expired or invalid GitHub PAT error. Minor capitalization issues do not prevent understanding.
Linked Issues check Passed Issue #404 requires a clear authentication warning when a configured GitHub PAT is expired, invalid, or revoked, instead of a generic HTTP error. The reviewed diff in src/context/AppContext.jsx (explo…
Out of Scope Changes check Passed The whole-PR diff against the merge base changes only src/context/AppContext.jsx, in the error handling of the explore function. The new HTTP_401 branch directly implements #404. The restructured RATE…
Full details: Linked Issues check

Explanation

Issue #404 requires a clear authentication warning when a configured GitHub PAT is expired, invalid, or revoked, instead of a generic HTTP error. The reviewed diff in src/context/AppContext.jsx (explore catch block) adds a branch for err.message === 'HTTP_401' that sets the error to 'Your GitHub PAT may have expired or become invalid. Please check or replace it in Settings.' The source of this error code is src/services/github.js at the reviewed head: fetchWithCache throws HTTP_${res.status} for non-OK responses, so an invalid, expired, or revoked token that yields a 401 produces HTTP_401 and reaches the new branch. The existing RATE_LIMIT messages are unchanged, which keeps the separate rate-limit behavior described in #404. The issue does not request automated tests or other non-code work. No coding requirement from #404 remains unmet based on the evidence reviewed. Limitation: the diff does not add a test for the new branch, and I did not trace the full call path from the search UI into explore. Neither gap blocks the verdict because the issue does not require a test.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base changes only src/context/AppContext.jsx, in the error handling of the explore function. The new HTTP_401 branch directly implements #404. The restructured RATE_LIMIT branch keeps the same messages as before, so it does not change unrelated behavior. The remaining else branch keeps the previous fallback of displaying err.message. The diff contains only whitespace and indentation changes beyond the logic change, and it adds no unrelated features, dependencies, or files. Minor note: the indentation of the catch block and the closing finally is inconsistent with the surrounding code, which is a style issue and not a scope issue.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

A rabbit searches, bright and quick,
A clear PAT warning joins the mix.
Rate limits keep their message true,
Other errors show their text to you.
The search returns, cleanup runs,
Then off the rabbit hops for fun.

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

@github-actions github-actions Bot added size/S 11-50 lines changed first-time-contributor First time contributor and removed size/S 11-50 lines changed labels Oct 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working first-time-contributor First time contributor frontend Frontend changes javascript JavaScript/TypeScript changes size/S 11-50 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Expired GitHub PAT displays a generic HTTP error instead of an authentication warning

1 participant