-
Notifications
You must be signed in to change notification settings - Fork 14
feat: support search param in activation url pattern #837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support search param in activation url pattern #837
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 1eeac18 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 |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ac02df9 to
6729fc9
Compare
630fc0e to
7493be5
Compare
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
There was a problem hiding this 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.
| pattern: new URLPattern({ | ||
| pathname: rule.pathname ?? undefined, | ||
| search: rule.search ?? undefined, | ||
| }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URLPattern matches all URLs when both fields undefined
Medium Severity
When both pathname and search are undefined or null in a GuideActivationUrlPatternData, the URLPattern constructor receives { pathname: undefined, search: undefined }, which defaults all components to wildcard patterns and matches every URL. The type's comment states "At least one part should be present" but this invariant isn't enforced in code. If the server sends malformed data, an "allow" directive would show guides on all pages, or a "block" directive would hide guides everywhere.
Additional Locations (1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, it is validated by the control backend to have at least one part.
fb694b4 to
632e822
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #837 +/- ##
==========================================
- Coverage 68.47% 68.45% -0.03%
==========================================
Files 193 193
Lines 8058 8061 +3
Branches 1065 1065
==========================================
Hits 5518 5518
- Misses 2515 2518 +3
Partials 25 25
|

Description
Add a
searchfield to GuideActivationUrlPatternData, and include it when initializing a new URLPattern, which is a new match field added in https://github.com/knocklabs/control/pull/7160.