Title: fix(mcp): open the OAuth popup synchronously and bound the start request by waleedlatif1 · Pull Request #5824 · simstudioai/sim · GitHub
Open Graph Title: fix(mcp): open the OAuth popup synchronously and bound the start request by waleedlatif1 · Pull Request #5824 · simstudioai/sim
X Title: fix(mcp): open the OAuth popup synchronously and bound the start request by waleedlatif1 · Pull Request #5824 · simstudioai/sim
Description: Summary Fixes the two reported OAuth UX failures (no popup after Add MCP; 'Reopen authorization window' pressing doing nothing): Popup-first: window.open previously ran after awaiting /api/mcp/oauth/start, outside the browser's user-activation window, so the popup was silently blocked — worst on the add-server flow (two awaits deep). The hook now opens about:blank synchronously in the click (named per server, so a re-click focuses/reuses an existing authorization window), navigates it once the start returns, and closes it on failure/already_authorized. A genuinely blocked popup shows a clear toast and skips the request entirely. Bounded start: /oauth/start had no client-side timeout, so a stalled start (the known transient body-stall) held the re-entrancy guard and the connecting label indefinitely — the button looked dead. The request is now bounded at 30s; on timeout the popup closes, the label resets to 'Connect with OAuth', and retry is immediately available. The mutation no longer opens windows (returns authorizationUrl + state); popup lifecycle lives in one place. Residual note: the add-server auto-start still sits after the create request, so an extremely slow create+probe can still exceed the activation window — but it now degrades to a clear 'Popup blocked' toast and a clean, clickable 'Connect with OAuth' state instead of a stuck label. Type of Change Bug fix (UX) Testing Hook tests updated + 2 new: popup opens before the start request resolves (popup-first ordering), and a blocked popup skips the request and leaves the row idle. 10/10 green; tsc + biome clean. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Fixes the two reported OAuth UX failures (no popup after Add MCP; 'Reopen authorization window' pressing doing nothing): Popup-first: window.open previously ran after awaiting /api...
X Description: Summary Fixes the two reported OAuth UX failures (no popup after Add MCP; 'Reopen authorization window' pressing doing nothing): Popup-first: window.open previously ran after await...
Opengraph URL: https://github.com/simstudioai/sim/pull/5824
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:d5a22bee-8f43-a6ce-a5ff-796c8159e30a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8190:3C31B4:1813B4:226DD7:6A636479 |
| html-safe-nonce | dadf303bb3a91e368e6fdf1aecda5ad3b02f5b2ca6df716f676c546a536ba652 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTkwOjNDMzFCNDoxODEzQjQ6MjI2REQ3OjZBNjM2NDc5IiwidmlzaXRvcl9pZCI6IjY3NzkwNzcwNjkyNjI1MTMyNzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1e9c84eb60554c79f5391435488a260a5aa0a6c5e6b1239e96aa8b1ab2efb285 |
| hovercard-subject-tag | pull_request:4103777405 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5824/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Fixes the two reported OAuth UX failures (no popup after Add MCP; 'Reopen authorization window' pressing doing nothing): Popup-first: window.open previously ran after awaiting /api... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 669d3fcd704a169521d2b6431762f95a6878a9e8ccaf0fd5f2d0802fc5b971f9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 20da292f132ff51328be50073854259f417052c1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width