fix(shared): respect trackOnlyCategories in generic isBot() fallback - #667
Conversation
|
@aditya3799 is attempting to deploy a commit to the Databuddy OSS Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThe PR makes the generic
Confidence Score: 4/5The PR appears safe to merge, with only a non-blocking indentation issue in the added test. The production change preserves the default blocking behavior and applies Files Needing Attention: packages/shared/src/utils/bot-detection/tests/detector.test.ts Important Files Changed
Reviews (1): Last reviewed commit: "fix(shared): respect trackOnlyCategories..." | Re-trigger Greptile |
| describe("Generic isBot() fallback — config should still apply", () => { | ||
| it("respects trackOnlyCategories for bots only caught by ua-parser-js's generic isBot()", () => { |
There was a problem hiding this comment.
Correct inverted test indentation
The new describe is indented more deeply than its child it, which visually misrepresents the test hierarchy and makes the structure harder to follow.
| describe("Generic isBot() fallback — config should still apply", () => { | |
| it("respects trackOnlyCategories for bots only caught by ua-parser-js's generic isBot()", () => { | |
| describe("Generic isBot() fallback — config should still apply", () => { | |
| it("respects trackOnlyCategories for bots only caught by ua-parser-js's generic isBot()", () => { |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Fixes #<PUT_YOUR_ISSUE_NUMBER_HERE>
Summary of Changes
Routes the generic
isBot()fallback indetectBot()throughgetAction(BotCategory.UNKNOWN_BOT, config)so thatconfig.trackOnlyCategoriesis properly respected.Reproduction & Verification
PowerShell/7.1.0andtrackOnlyCategories: [BotCategory.UNKNOWN_BOT].packages/shared/src/utils/bot-detection/__tests__/detector.test.ts.AI Usage Disclosure
Assisted by AI (Antigravity) for draftingt eh message of issue and pull request and finding a new user-agent alis for testing the fix. Implementation and tests were verified locally using
bun testandbun run lint.Fixes #666
Summary by cubic
Respect trackOnlyCategories in the generic isBot() fallback. Previously, unknown bots caught by
ua-parser-js’s generic isBot() always BLOCKed; now we derive the action via getAction so UNKNOWN_BOT can be TRACK_ONLY when configured.Written for commit ab30155. Summary will update on new commits.