Skip to content

chore: handle (re)subscribe in guide toolbar V2 when entering/exiting#943

Draft
thomaswhyyou wants to merge 6 commits intomainfrom
thomas-kno-12539-toolbar-fix-not-authenticated-error-in-new-sdk-version-3
Draft

chore: handle (re)subscribe in guide toolbar V2 when entering/exiting#943
thomaswhyyou wants to merge 6 commits intomainfrom
thomas-kno-12539-toolbar-fix-not-authenticated-error-in-new-sdk-version-3

Conversation

@thomaswhyyou
Copy link
Copy Markdown
Contributor

Description

** Describe what, why and how of the changes clearly and concisely. Add any additional useful context or info, as necessary. **

Todos

** List any todo items necessary before merging, if any. Delete if none. **

  • Sample todo item 1
  • Sample todo item 2

Checklist

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

Screenshots or videos

** Attach any screenshots or recordings to visually illustrate the changes, as necessary. Delete if not relevant. **

@linear
Copy link
Copy Markdown

linear bot commented Apr 9, 2026

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2026

⚠️ No Changeset found

Latest commit: 63df698

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

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

Project Deployment Actions Updated (UTC)
javascript-ms-teams-connect-example Ready Ready Preview, Comment Apr 9, 2026 8:21pm
javascript-nextjs-example Ready Ready Preview, Comment Apr 9, 2026 8:21pm
javascript-slack-connect-example Ready Ready Preview, Comment Apr 9, 2026 8:21pm
javascript-slack-kit-example Ready Ready Preview, Comment Apr 9, 2026 8:21pm

Request Review

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

@thomaswhyyou thomaswhyyou force-pushed the thomas-kno-12539-toolbar-fix-not-authenticated-error-in-new-sdk-version-3 branch from 7d120df to 4e39774 Compare April 9, 2026 19:39
@thomaswhyyou thomaswhyyou force-pushed the thomas-kno-12539-toolbar-fix-not-authenticated-error-in-new-sdk-version-2 branch from bdda172 to 0489df2 Compare April 9, 2026 19:39
@thomaswhyyou thomaswhyyou force-pushed the thomas-kno-12539-toolbar-fix-not-authenticated-error-in-new-sdk-version-2 branch from 0489df2 to deae866 Compare April 9, 2026 19:44
@thomaswhyyou thomaswhyyou force-pushed the thomas-kno-12539-toolbar-fix-not-authenticated-error-in-new-sdk-version-3 branch from 4e39774 to a9698fd Compare April 9, 2026 19:44
@thomaswhyyou thomaswhyyou force-pushed the thomas-kno-12539-toolbar-fix-not-authenticated-error-in-new-sdk-version-3 branch from a9698fd to ab5fe31 Compare April 9, 2026 19:48
@thomaswhyyou thomaswhyyou force-pushed the thomas-kno-12539-toolbar-fix-not-authenticated-error-in-new-sdk-version-2 branch from deae866 to 7e4dc86 Compare April 9, 2026 19:48
@thomaswhyyou thomaswhyyou changed the title handle (re)subscribe in guide toolbar V2 when stop debugging chore: handle (re)subscribe in guide toolbar V2 when exiting Apr 9, 2026
@thomaswhyyou thomaswhyyou changed the title chore: handle (re)subscribe in guide toolbar V2 when exiting chore: handle (re)subscribe in guide toolbar V2 when entering/exiting Apr 9, 2026
@thomaswhyyou
Copy link
Copy Markdown
Contributor Author

@cursor review

Copy link
Copy Markdown

@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.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ab5fe31. Configure here.

stopDebug();
}

return () => stopDebug();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cleanup unconditionally calls stopDebug causing spurious side effects

Medium Severity

The cleanup function unconditionally calls stopDebug(), which always invokes client.unsetDebug() and client.subscribe()/client.unsubscribe(), even when the toolbar was never visible and debug mode was never entered. Since the V2 component is always rendered (returns null when not visible, but hooks still run), any change to readyToTarget or listenForUpdates triggers this cleanup. When listenForUpdates is true, the spurious subscribe() call disconnects and reconnects the websocket channel unnecessarily. Additionally, subscribe() calls this.knock.failIfNotAuthenticated() which throws if the user is unauthenticated — unlike the old code in setDebug/unsetDebug that guarded against this. During logout/unmount, this cleanup can throw an unhandled error. The cleanup needs a guard to only call stopDebug() when debug mode was actually entered.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ab5fe31. Configure here.

@thomaswhyyou thomaswhyyou force-pushed the thomas-kno-12539-toolbar-fix-not-authenticated-error-in-new-sdk-version-3 branch from ab5fe31 to 63df698 Compare April 9, 2026 20:20
@thomaswhyyou thomaswhyyou force-pushed the thomas-kno-12539-toolbar-fix-not-authenticated-error-in-new-sdk-version-2 branch from 7e4dc86 to 43c0e12 Compare April 9, 2026 20:20
Base automatically changed from thomas-kno-12539-toolbar-fix-not-authenticated-error-in-new-sdk-version-2 to main April 9, 2026 20:30
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.

1 participant