Fix bot misdetection for Instagram webview on Pixel devices#3873
Fix bot misdetection for Instagram webview on Pixel devices#3873pepeladeira wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe bot detection utility now pre-processes User-Agent strings to remove known false-positive patterns before applying bot classification heuristics. This reduces misclassification for edge cases like in-app webviews that append non-bot markers to their User-Agent. ChangesBot Detection False-Positive Filtering
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web/lib/middleware/utils/bots-list.ts`:
- Around line 24-26: Bot detection lost coverage for several Google user agents
when "google" was removed; update the bots list in
apps/web/lib/middleware/utils/bots-list.ts by re-adding specific Google crawler
identifiers (e.g., "GoogleOther", "Google-InspectionTool", "Google-Read-Aloud",
"Google-Extended") alongside the existing "Mediapartners-Google" entry so those
UAs match, and update the adjacent comment to correct that AdsBot-Google is
matched via the generic "bot" pattern (not "fetch"). Ensure entries are
lowercase or rely on case-insensitive matching used elsewhere so they align with
the matcher behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a5799427-0190-4b9f-9f0d-667506c16d27
📒 Files selected for processing (1)
apps/web/lib/middleware/utils/bots-list.ts
Summary by CodeRabbit