Repository navigation
Fire the mobile /app/main redirect on iOS regardless of userAgentData - #66
Conversation
isMobileUserAgent() consulted navigator.userAgentData.mobile first, which stays false on Chromium under a spoofed iOS UA string (DevTools, UA switchers, desktop request-mobile-site), so the /app/main redirect never fired on iPhone/iPad in those cases. Check for iPhone/iPad/iPod in the UA first — iOS Safari exposes no userAgentData anyway — and split the logic into a pure isMobileUA() with unit coverage.
|
Warning Review limit reached
Next review available in: 44 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 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 |
Follow-up to #65. That PR made
/app/mainrender on iOS; this makes the redirect that sends users there actually fire on iOS.Problem
isMobileUserAgent()consultednavigator.userAgentData.mobilefirst. On Chromium that bit staysfalseunder a spoofed iOS UA string (DevTools device mode, a UA switcher, desktop "request mobile site"), so the opt-in/app/mainredirect was skipped even though the UA clearly said iPhone. Reproduced with an iOS UA on Chromium:userAgentData.mobile === false→isMobileUserAgent()returnedfalse, no redirect.(On a real iPhone, Safari exposes no
userAgentData, so the existingAndroid|Mobilesniff already caught it — but every Chromium-based test/spoof path was broken.)Fix
iPhone/iPad/iPodin the UA now wins first, thenuserAgentData.mobile, then the existingAndroid|Mobilesniff. The logic is extracted into a pureisMobileUA(userAgent, userAgentData)so it can be unit-tested directly.Testing
npm testpasses, including newisMobileUAcases: iOS with nouserAgentData, iOS withuserAgentData.mobile === false(the spoof case), Android Chrome, Firefox Android, and desktop./app/main(previously it stayed on the desktop page).