Persist anonymous users-by-location and fix IPv6 geo - #120
Merged
Merged
Conversation
Keep a k-anonymized 365-day last-known region on daily rollups so the stats globe survives the 7-day event wipe, resolve client IPs via Fly-Client-IP with a sibling IPv6 DB-IP table, and stop Chrome from painting the footer language select white-on-white. Co-authored-by: Cursor <cursoragent@cursor.com>
Hourly rollups no longer overwrite a real region with unknown on the same day, so first-day installs stay on the globe. Also restore the i18n extract and serial-chain gates that CI failed on. Co-authored-by: Cursor <cursoragent@cursor.com>
Rollups built only from successful lookups, so a day with no hit always stored geo_kind 'unknown' and the column could never explain why a region was missing once raw events expired. Seed from the latest event first and let the last successful lookup win; an unknown row now refreshes its kind while a real region's kind is still never overwritten.
…retention The ingest comments and data README still said the IP was used twice and that no per-install region was kept; region and geo_kind now live on the 365-day daily rollup and are only published behind the k>=5 floor.
The privacy policy still said region lived only in daily aggregates and that no per-install location was kept. The coarse label and address family now sit on each install's 365-day daily rollup, so the region, IP-use and retention bullets say so, the date moves to September 2026, and the August text is archived under Policy History. The /stats globe now plots the 365-day last-known census, so its caption and aria label stop calling it today's hourly aggregate. All six locales are updated; the August archive body reuses each locale's existing page translations.
On the 2026-09 DB-IP release the IPv6 table cost 82 MB and a 3-4.5 s synchronous BigInt parse on the first IPv6 request after boot, leaving thin headroom on the 256 MB VM. DB-IP carries no location below a /64 (4,312 of 2.19 M ranges are narrower), so the artifact now stores each bound as its /64 prefix in 16 hex digits and the loader keeps four Uint32 columns. Lookups match the old table on 99.996% of sampled addresses; the table drops to 42 MB and loads in about half a second. In a 256 MB container the server settles near 150 MB instead of 179 MB. DB-IP also labels private and reserved space (10/8, loopback, link-local, ULA including Fly 6PN) as country ZZ, which came back as a real region. The refresh script now drops those rows and the lookup reports ZZ as unknown for files generated before this change.
Rollups older than today-364 stay in the table until the hourly housekeeper deletes them, and the census had no day bound, so for up to an hour after UTC midnight the globe counted installs that users_365d already excluded. Filter selectLastKnownRollupRegions to the same today..today-364 window and let buildHeadlineJson take an injected clock so tests stay date-independent.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
users_by_region_365d.Fly-Client-IPand look up native IPv6 against a sibling DB-IP table instead of collapsing Fly anycast/6PN onto US-CA or unknown.color-schemeand an opaque footer language-select background so Chrome/Firefox stop painting white-on-white in dark mode.Test plan
popular_regionsMade with Cursor