Skip to content

Conversation

@connorlindsey
Copy link
Contributor

@connorlindsey connorlindsey commented Jan 21, 2026

Description

In some cases, window.postMessage fails, so this PR adds some polling to see if the connection has been established.

Checklist

  • Tests have been added for new features or major refactors to existing features.

Screenshots or videos

Example where I hard-coded the popup HTML response to not auto close or send the success message. The button updating to 'Connected' and closing the popup is from the polling codepath.
https://github.com/user-attachments/assets/bc411148-643d-4e8a-9175-d567ac37a25c

@linear
Copy link

linear bot commented Jan 21, 2026

@vercel
Copy link

vercel bot commented Jan 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
javascript-ms-teams-connect-example Ready Ready Preview, Comment Jan 22, 2026 5:43pm
javascript-nextjs-example Ready Ready Preview, Comment Jan 22, 2026 5:43pm
javascript-slack-connect-example Ready Ready Preview, Comment Jan 22, 2026 5:43pm
javascript-slack-kit-example Ready Ready Preview, Comment Jan 22, 2026 5:43pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Jan 21, 2026

🦋 Changeset detected

Latest commit: 6dce500

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@knocklabs/react-core Patch
@knocklabs/react Patch
@knocklabs/expo Patch
@knocklabs/react-native Patch
guide-example Patch
ms-teams-connect-example Patch
nextjs-app-dir-example Patch
nextjs-example Patch
slack-connect-example Patch
slack-kit-example Patch
@knocklabs/expo-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

cursor[bot]

This comment was marked as outdated.

@connorlindsey connorlindsey changed the title fix: add broadcast channel listener for Slack OAuth flow fix: add polling to make OAuth flows more robust to popup communication failure Jan 21, 2026
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

Choose a reason for hiding this comment

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

🍩

cursor[bot]

This comment was marked as outdated.

@connorlindsey connorlindsey force-pushed the connor-kno-11283-switchboard-multiple-reports-of-slack-oauth-connection-issue branch from 6999528 to 6dce500 Compare January 22, 2026 17:42
cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@connorlindsey connorlindsey merged commit f9aca69 into main Jan 22, 2026
12 checks passed
@connorlindsey connorlindsey deleted the connor-kno-11283-switchboard-multiple-reports-of-slack-oauth-connection-issue branch January 22, 2026 18:17
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 88.00000% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.45%. Comparing base (f6e494a) to head (6dce500).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...components/MsTeamsAuthButton/MsTeamsAuthButton.tsx 74.19% 8 Missing ⚠️
...ack/components/SlackAuthButton/SlackAuthButton.tsx 74.19% 8 Missing ⚠️
...eact-core/src/modules/core/hooks/useAuthPolling.ts 95.23% 3 Missing ⚠️
...e/src/modules/slack/context/KnockSlackProvider.tsx 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #830      +/-   ##
==========================================
+ Coverage   67.84%   68.45%   +0.60%     
==========================================
  Files         190      193       +3     
  Lines        7934     8052     +118     
  Branches     1041     1062      +21     
==========================================
+ Hits         5383     5512     +129     
+ Misses       2526     2515      -11     
  Partials       25       25              
Files with missing lines Coverage Δ
packages/react-core/src/index.ts 100.00% <ø> (ø)
...ackages/react-core/src/modules/core/hooks/index.ts 100.00% <100.00%> (ø)
...c/modules/core/hooks/useAuthPostMessageListener.ts 100.00% <100.00%> (ø)
packages/react-core/src/modules/core/index.ts 100.00% <100.00%> (ø)
packages/react-core/src/modules/core/types.ts 100.00% <100.00%> (ø)
.../modules/ms-teams/context/KnockMsTeamsProvider.tsx 92.00% <100.00%> (+0.51%) ⬆️
...dules/ms-teams/hooks/useMsTeamsConnectionStatus.ts 87.75% <ø> (ø)
...rc/modules/slack/hooks/useSlackConnectionStatus.ts 90.00% <ø> (ø)
packages/react/src/modules/core/utils.ts 71.42% <100.00%> (ø)
...e/src/modules/slack/context/KnockSlackProvider.tsx 18.18% <50.00%> (+0.87%) ⬆️
... and 3 more

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.

3 participants