Skip to content

Catch and show proxy error during sign in - #411

Merged
brucetony merged 2 commits into
developfrom
410-add-proxy-timeout-toast
Aug 11, 2026
Merged

Catch and show proxy error during sign in#411
brucetony merged 2 commits into
developfrom
410-add-proxy-timeout-toast

Conversation

@brucetony

@brucetony brucetony commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added identity-provider availability checks before sign-in.
    • Added clear notifications when the identity provider is unavailable or reports an error.
    • Added a health check endpoint to report identity-provider connectivity.
  • Bug Fixes

    • Prevented sign-in attempts when the identity provider cannot be reached.
    • Improved error handling and messaging for failed authentication requests.

@brucetony brucetony linked an issue Aug 11, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@brucetony, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 208cb9df-d010-4754-a579-1ad3c264672b

📥 Commits

Reviewing files that changed from the base of the PR and between 145d6cd and 3df9b7f.

📒 Files selected for processing (1)
  • server/routes/flame/api/health.get.ts
📝 Walkthrough

Walkthrough

The PR adds an identity-provider health endpoint and client-side reachability checks. Avatar and landing-page sign-in actions now show an error toast and skip authentication when the identity provider is unreachable.

Changes

Identity-provider sign-in availability

Layer / File(s) Summary
Identity-provider health endpoint
server/routes/flame/api/health.get.ts
The server checks the identity provider’s OpenID configuration through the configured proxy and returns structured reachability results.
Client health check and failure feedback
app/composables/useIdpHealth.ts, app/composables/connectionErrorToast.ts
The client evaluates health results, logs failures, and displays an 8-second toast when the identity provider is unreachable.
Guarded sign-in entry points
app/components/header/AvatarButton.vue, app/components/landing/IdpAuthBtns.vue
The avatar menu and landing-page login button check identity-provider reachability before invoking signIn. The guarded flow uses PrimeVue toast feedback.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SignInEntryPoint
  participant useIdpHealth
  participant HealthEndpoint
  participant IdentityProvider
  participant ToastService
  participant signIn

  User->>SignInEntryPoint: Select login
  SignInEntryPoint->>useIdpHealth: checkIdpReachable(toast)
  useIdpHealth->>HealthEndpoint: Fetch /flame/api/health
  HealthEndpoint->>IdentityProvider: Request OpenID configuration
  IdentityProvider-->>HealthEndpoint: Reachability response
  HealthEndpoint-->>useIdpHealth: Health result

  alt Identity provider reachable
    useIdpHealth-->>SignInEntryPoint: true
    SignInEntryPoint->>signIn: Start authentication
  else Identity provider unreachable
    useIdpHealth->>ToastService: Show sign-in failure toast
    useIdpHealth-->>SignInEntryPoint: false
  end
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: detecting proxy or identity-provider errors and showing them during sign-in.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 410-add-proxy-timeout-toast

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@server/routes/flame/api/health.get.ts`:
- Around line 36-38: Update the health endpoint’s error return after
describeFetchError(error) so it keeps the detailed message and error only in
console.error, while returning a fixed user-safe error message instead of the
raw upstream diagnostic. Preserve the existing reachable: false response shape.
- Around line 19-33: Update the discovery request flow around the fetch response
to capture response.ok and response.status, then await response.body?.cancel()
before either success or failure return. Preserve the existing status warning
and reachable/error results while ensuring the response body is canceled on both
branches.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b377d3b-2940-44cc-aab5-506008f2b3b2

📥 Commits

Reviewing files that changed from the base of the PR and between c37e2bd and 145d6cd.

📒 Files selected for processing (5)
  • app/components/header/AvatarButton.vue
  • app/components/landing/IdpAuthBtns.vue
  • app/composables/connectionErrorToast.ts
  • app/composables/useIdpHealth.ts
  • server/routes/flame/api/health.get.ts

Comment thread server/routes/flame/api/health.get.ts
Comment thread server/routes/flame/api/health.get.ts Outdated
@brucetony
brucetony merged commit d256ebd into develop Aug 11, 2026
3 checks passed
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.

Add proxy timeout toast

1 participant