You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(mship): settle the connect row from the popup, not from focus alone
Addresses the review findings on the chat OAuth return leg.
- Watch the popup on an interval. A provider interstitial bouncing to the
workspace root, a denied consent on /oauth-error, or a closed window all end
the flow without publishing a verdict or firing any event in this tab, so the
row waited forever. The focus handler also no longer consumes the away flag
when it defers to a live popup.
- Focus an already-running popup on a repeat click instead of starting a rival
attempt, which orphaned the first flow's verdict on an attempt id the row had
stopped reading.
- Settle from the refetched credentials on the popup success path, so the row's
lock is corroborated and a connected row stops being clickable.
Extracts the shared refetch-then-decide step into settleFromCredentials, used
by the focus handler, the popup watcher, and the success path.
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags/special-tags.test.tsx
+197Lines changed: 197 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -505,6 +505,133 @@ describe('CredentialDisplay link tag', () => {
505
505
act(()=>root.unmount())
506
506
})
507
507
508
+
it('settles the row from the popup watcher when the flow ends with no event in this tab',async()=>{
509
+
// A provider interstitial (Trello parks on one for ~3s) bounces to the
510
+
// workspace root without ever reaching the completion page. Neither page
511
+
// publishes a verdict, and a user who never leaves this tab gets no focus
512
+
// event either — only the watcher can end the wait.
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags/use-oauth-chip-connection.ts
+89-44Lines changed: 89 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,12 @@ import { useWorkspaceCredentials } from '@/hooks/queries/credentials'
28
28
constOAUTH_POPUP_WINDOW_NAME='sim-oauth-connect'
29
29
/** Matches the MCP OAuth popup (`hooks/mcp/use-mcp-oauth-popup.ts`) so the two consent windows open alike. */
0 commit comments