Skip to content

Persist anonymous users-by-location and fix IPv6 geo - #120

Merged
LakshmanTurlapati merged 7 commits into
mainfrom
users-by-location
Sep 28, 2026
Merged

LakshmanTurlapati merged 7 commits into
mainfrom
users-by-location

Conversation

@LakshmanTurlapati

Copy link
Copy Markdown
Collaborator

Summary

  • Persist a k-anonymized last-known region on 365-day daily rollups so the stats globe still plots after the 7-day raw-event wipe, and expose it as users_by_region_365d.
  • Resolve client IPs from Fly-Client-IP and look up native IPv6 against a sibling DB-IP table instead of collapsing Fly anycast/6PN onto US-CA or unknown.
  • Set theme color-scheme and an opaque footer language-select background so Chrome/Firefox stop painting white-on-white in dark mode.

Test plan

  • Stats globe uses 365-day regions when present and still falls back to popular_regions
  • IPv6 fixture lookups and Fly-Client-IP hashing never persist plaintext IP
  • Footer language picker stays readable in Chrome dark mode and light mode

Made with Cursor

LakshmanTurlapati and others added 7 commits September 17, 2026 19:20
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.
@LakshmanTurlapati
LakshmanTurlapati merged commit 44d3438 into main Sep 28, 2026
14 checks passed
@LakshmanTurlapati LakshmanTurlapati mentioned this pull request Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant