Replace geolocation API - #100
Conversation
We had been missing app_loaded events because the Kamero API deployment had been 'paused'. Other events were still coming through, which clued me in that something was wrong (it wasn't just that people stopped visiting the site). ipwhois seems like a more production-apt service, since it comes with a 99.99% uptime SLA. On the free tier we get 1000 requests per day.
📝 WalkthroughWalkthroughThe geolocation endpoint now uses ipwho.is, with inline documentation added. The Analytics README description removes the previous provider attribution while retaining the existing coarse-location and Posthog flow. ChangesGeolocation provider update
Estimated code review effort: 2 (Simple) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 `@src/utils/externalURLs.ts`:
- Around line 1-3: Update the analytics flow that fetches locationURL so
app_loaded is emitted independently of the external ipwho.is response; handle
the lookup as best-effort or proxy/cache it server-side, ensuring provider
failures, limits, or outages cannot suppress app_loaded.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 8b79993d-d229-4388-bdc5-8f780bef35bb
📒 Files selected for processing (2)
README.mdsrc/utils/externalURLs.ts
We had been missing app_loaded events because the Kamero API deployment had been 'paused'. Other events were still coming through (though they will have been missing their location parameter), which clued me in that something was wrong (it wasn't just that people stopped visiting the site).
ipwhois seems like a more production-apt service, since it comes with a 99.99% uptime SLA. On the free tier we get 1000 requests per day.
Evidence that this code now works: you can see it coming through for localhost on Posthog, with the correct country: https://eu.posthog.com/project/128512/events/019f89b7-b309-7f70-b443-257ef31ab96a/2026-07-22T12%3A05%3A45.386000Z
Added an annotation to the posthog dashboard:
