Skip to content

fix(composio): show waiting state before opening browser#2406

Merged
senamakel merged 1 commit into
tinyhumansai:mainfrom
aqilaziz:codex/2354-composio-openurl-waiting-fallback
May 23, 2026
Merged

fix(composio): show waiting state before opening browser#2406
senamakel merged 1 commit into
tinyhumansai:mainfrom
aqilaziz:codex/2354-composio-openurl-waiting-fallback

Conversation

@aqilaziz
Copy link
Copy Markdown
Contributor

@aqilaziz aqilaziz commented May 21, 2026

Summary

  • move Composio connect modal into waiting/polling state immediately after authorize returns a connectUrl
  • keep the Reopen browser fallback visible even if the OS browser opener rejects
  • add regression coverage for an opener failure path so the connect click does not collapse into a dead/no-response state

Refs #2354

Checks

  • prettier --check src/components/composio/ComposioConnectModal.tsx src/components/composio/ComposioConnectModal.test.tsx
  • pnpm test:unit src/components/composio/ComposioConnectModal.test.tsx
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes
    • Improved resilience of the authentication flow by handling browser launch failures gracefully. Users can now manually reopen their browser instead of encountering a complete connection failure.

Review Change Stack

@aqilaziz aqilaziz requested a review from a team May 21, 2026 02:40
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f5df3059-85ad-4e1e-8a09-7b4547885d82

📥 Commits

Reviewing files that changed from the base of the PR and between 6281aea and 6246840.

📒 Files selected for processing (2)
  • app/src/components/composio/ComposioConnectModal.test.tsx
  • app/src/components/composio/ComposioConnectModal.tsx

📝 Walkthrough

Walkthrough

The Composio connect modal's authorization flow now handles browser-opening failures gracefully. After authorization succeeds, the component transitions to waiting and starts polling before attempting to open the browser URL. Browser-open failures are caught locally and logged as warnings, allowing the polling to continue instead of aborting to an error state. A new test case verifies this behavior.

Changes

Error-resilient browser opening

Layer / File(s) Summary
Error-resilient browser open with polling reordering
app/src/components/composio/ComposioConnectModal.tsx, app/src/components/composio/ComposioConnectModal.test.tsx
After authorize returns, the flow transitions to waiting and starts polling before attempting openUrl. The openUrl call is wrapped in a try/catch that logs warnings on failure, allowing the connect flow to continue. A new test verifies the modal displays "Reopen browser" and "Waiting for Gmail" when browser opening fails, without showing the generic error message.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • tinyhumansai/openhuman#1893: Both PRs modify the Composio connect modal's phase handling in handleConnect (this PR reorders the waiting/openUrl flow and adds error handling; the related PR extends the state machine with an expired phase).

Suggested labels

working

Poem

🐰 When the browser won't open, no need to despair,
The modal keeps waiting with patient flair,
A warning logged softly, the flow carries on,
Graceful recovery—resilience is dawn! 🌙

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately summarizes the main change: transitioning the Composio modal to a waiting state before attempting to open the browser, which aligns with the core objective of the PR.
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.

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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

@coderabbitai coderabbitai Bot added the working A PR that is being worked on by the team. label May 21, 2026
@senamakel senamakel merged commit 2f913a2 into tinyhumansai:main May 23, 2026
28 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

working A PR that is being worked on by the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants