LearnNewsExamplesServices
Frontmatter
id9142
title[DevIndex] Create Country Code Repair Script
stateClosed
labels
aifeature
assigneestobiu
createdAtFeb 13, 2026, 1:19 PM
updatedAtFeb 13, 2026, 1:29 PM
githubUrlhttps://github.com/neomjs/neo/issues/9142
authortobiu
commentsCount2
parentIssue9106
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 13, 2026, 1:29 PM

[DevIndex] Create Country Code Repair Script

Closed v12.0.0 aifeature
tobiu
tobiu commented on Feb 13, 2026, 1:19 PM

Since the LocationNormalizer is only applied during fresh API fetches, waiting for the update cycle would leave inconsistent data (broken flags) for existing records.

We need a one-off repair script to apply the new rules to the existing dataset immediately.

Scope:

  1. Create apps/devindex/buildScripts/fixCountryCodes.mjs.
  2. Use the Storage service to load all users.
  3. Re-run LocationNormalizer on every user's location string.
  4. Update and save the records if the country code changes (e.g., 'DC' -> 'US').
tobiu added the ai label on Feb 13, 2026, 1:19 PM
tobiu added the feature label on Feb 13, 2026, 1:19 PM
tobiu added parent issue #9106 on Feb 13, 2026, 1:19 PM
tobiu referenced in commit 86775fd - "fix: Apply expanded LocationNormalizer to users.jsonl (#9142) on Feb 13, 2026, 1:27 PM
tobiu
tobiu Feb 13, 2026, 1:28 PM

Input from Gemini 3 Pro:

✦ I have executed the fixCountryCodes.mjs script again after enhancing the LocationNormalizer.

Key Improvements:

  1. Full US State Names: Now correctly identifying "Ohio", "Utah", "Colorado", "Minnesota", etc. as 'US'.
  2. Cities: "Genoa" (IT), "Atlanta" (US), "Salt Lake City" (US), "Medina" (US).
  3. Conflict Resolution: "Georgia" (Country) vs "Georgia" (US State). The logic currently maps "Georgia" -> 'US' via the state name check.
    • Observation: Users like "m-burst" and "rlidwka" have location "Tbilisi, Georgia", which is the country. My script mapped them to 'US'.
    • Correction: I need to refine the regex to NOT match "Georgia" if it's "Tbilisi, Georgia". Or accept that "Georgia" alone is ambiguous but "Tbilisi" makes it 'GE'.
    • Wait: LocationNormalizer does not have "Tbilisi" in the city map. Adding "Tbilisi" -> 'GE' would fix this.

Proposed Follow-up: I noticed "Tbilisi, Georgia" getting mapped to 'US' because of the "Georgia" state match. I should add "Tbilisi" to the city map to correctly resolve these to 'GE' (Georgia - Country) before the US state check.

However, ISO code for Georgia (Country) is GE. The current script mapped them to US.

I will do one more quick pass to fix "Tbilisi".

tobiu referenced in commit fedfc52 - "fix: Add Tbilisi mapping to LocationNormalizer (#9142)" on Feb 13, 2026, 1:28 PM
tobiu
tobiu Feb 13, 2026, 1:29 PM

Input from Gemini 3 Pro:

✦ Fixed "Tbilisi" resolving to 'US' (via Georgia state match). It now correctly resolves to 'GE'. Updated 2 records. Closing ticket.

tobiu assigned to @tobiu on Feb 13, 2026, 1:29 PM
tobiu closed this issue on Feb 13, 2026, 1:29 PM