Skip to content

Add timeout request in case of misconfigured proxy - #359

Merged
brucetony merged 2 commits into
developfrom
add-request-timeout
Apr 22, 2026
Merged

Add timeout request in case of misconfigured proxy#359
brucetony merged 2 commits into
developfrom
add-request-timeout

Conversation

@brucetony

@brucetonybrucetony commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added a specific connection-error toast that gives clearer guidance when requests fail due to likely proxy issues.
  • Bug Fixes

    • Standardized request timeout behavior so long-running analysis operations now time out consistently (30s), routing timeout/abort failures through the improved error messaging.

@coderabbitai

coderabbitaiBot commented Apr 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 05450fce-9c1b-4509-8efa-329fabd19b32

📥 Commits

Reviewing files that changed from the base of the PR and between 1806e61 and 6559cfa.

📒 Files selected for processing (1)
  • app/components/analysis/AnalysisControlButtons.vue
✅ Files skipped from review due to trivial changes (1)
  • app/components/analysis/AnalysisControlButtons.vue

📝 Walkthrough

Walkthrough

Global API client timeout set to 30s with request error handling that surfaces a proxy-related toast on timeouts/aborts; analysis start/stop/terminate calls set timeout: 0 to opt out of the global timeout. A new helper emits the proxy error toast and logs a warning.

Changes

Cohort / File(s)Summary
API Timeout Configuration
app/plugins/api.ts
Create $fetch client with timeout: 30000 and call showProxyErrorToast from onRequestError when error.name is TimeoutError or AbortError.
Proxy Error Toast Helper
app/composables/connectionErrorToast.ts
Add export function showProxyErrorToast(toast) that shows a standardized proxy/configuration connection error toast and logs a console warning.
Analysis Control Buttons
app/components/analysis/AnalysisControlButtons.vue
Set timeout: 0 on analysis initialize/stop/terminate requests; minor reformatting of showToast(...) calls without behavioral changes.

Sequence Diagram(s)

sequenceDiagram
participant UI as Analysis UI
participant Client as $fetch Client
participant Plugin as api plugin
participant Toast as Toast Service
participant Helper as connectionErrorToast
rect rgba(200,200,255,0.5)
UI->>Client: POST /analysis/initialize (timeout: 0) or other analysis calls
Client-->>UI: HTTP response
end
rect rgba(200,255,200,0.5)
UI->>Client: Other API request
Client->>Plugin: request (global timeout 30s)
Plugin-->>Client: TimeoutError / AbortError
Client->>Plugin: trigger onRequestError
Plugin->>Helper: showProxyErrorToast(toast)
Helper->>Toast: show connection/proxy error toast
Helper->>Plugin: console.warn("Hub unreachable - proxy config?")
Plugin-->>Client: error propagated
end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped a route, a fetch in chase,
A thirty-second sprint through network space.
When timeouts gripe and proxies hide,
I nuzzle a toast and warn with pride.
For analysis runs, I grant more time — hop!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately reflects the main change: adding timeout configuration to requests to handle misconfigured proxy scenarios.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-request-timeout

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 and usage tips.

@coderabbitaicoderabbitaiBot 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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/plugins/api.ts`:
- Line 44: The global $fetch timeout in app/plugins/api.ts is 30000ms which
aborts the stop and terminate requests before their local 60s raceWithTimeout
can trigger; update the two calls in
app/components/analysis/AnalysisControlButtons.vue that call the /po/stop/{id}
and /analysis/terminate/{id} endpoints (the methods that perform the
stop/terminate HTTP calls) to pass an explicit timeout: 0 option (same pattern
used by /analysis/initialize) so they are not subject to the global 30s limit
and can rely on the component's 60s timeout handling.
🪄 Autofix (Beta)

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

Run ID: 9445d38b-f072-4fe3-9629-fce02ae263f9

📥 Commits

Reviewing files that changed from the base of the PR and between 9f0ae10 and 1806e61.

📒 Files selected for processing (3)
  • app/components/analysis/AnalysisControlButtons.vue
  • app/composables/connectionErrorToast.ts
  • app/plugins/api.ts

Comment threadapp/plugins/api.ts
@brucetony
brucetony merged commit ddb01f0 into developApr 22, 2026
5 checks passed
@brucetony
brucetony deleted the add-request-timeout branch April 22, 2026 09:57
Sign up for freeto 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.

1 participant

@brucetony