fix: coordinate the first fetch in guide toolbar v2 and guide client via readyToTarget#942
Conversation
🦋 Changeset detectedLatest commit: 43c0e12 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@cursor review |
bdda172 to
0489df2
Compare
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit bdda172. Configure here.
43246dc to
9afa1e6
Compare
0489df2 to
deae866
Compare
9afa1e6 to
8e1801d
Compare
deae866 to
7e4dc86
Compare
| `[Guide] Stop debugging, refetching guides and resubscribing to the websocket channel`, | ||
| ); | ||
| this.fetch({ force: true }); | ||
| // TODO: Manage (re)subscribe/unsubscribe in V2 rather than here. |
| }, predicateDefault); | ||
| }; | ||
|
|
||
| // Use this param to start Toolbar v2 and enter into a debugging session when |
There was a problem hiding this comment.
Just moved, not new.
| const { isVisible = false, focusedGuideKeys = {} } = runConfig || {}; | ||
| const isDebugging = client.store.state.debug?.debugging; | ||
| if (isVisible && !isDebugging) { | ||
| if (isVisible && !isDebugging && readyToTarget) { |
There was a problem hiding this comment.
This is the main change: We check if readyToTarget is true before making the fetch call.
7e4dc86 to
43c0e12
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #942 +/- ##
==========================================
- Coverage 63.91% 63.85% -0.06%
==========================================
Files 209 209
Lines 9990 10007 +17
Branches 1277 1281 +4
==========================================
+ Hits 6385 6390 +5
- Misses 3580 3592 +12
Partials 25 25
|


Description
This PR aims to address the issue Webflow flagged (here), where the guide toolbar v2 immediately tries to fetch guides upon mounting but results in an error due to not having been authenticated, because Webflow fetches and passes user id to the knock client asynchronously which then authenticates.
KnockGuideProvideralready provides thereadyToTargetprop for controlling when the guide client fires a request to fetch guides. In this PR the toolbar now receives thereadyToTargetprop also so it can control and coordinate the fetch call.