Skip to content

Markers/landmark nodes missing country/district (legacy edit flow; no parent inheritance) → 'Unknown Country' #4

Open

Description

@comaeclipse

Severity: low/medium (data accuracy; "Unknown Country" grouping) · Status: open

Symptom

Some markers and landmark nodes have no country (and district) even though it is derivable from their parent city node, so they bucket under "Unknown Country" on /locations and lose the value via COALESCE.

Jerusalem video (lrmE-WiC4eA):

marker type country location node node country
197 city stop Israel ✓ city-SmVydXNhbGVt (Jerusalem) Israel ✓
198 landmark '' zqqgo4si (Yeshivat Netiv Aryeh) NULL
199 landmark '' e75wgcw6 (Saint Michael Hotel) NULL

Both landmark nodes' parent city (Jerusalem) has country = Israel — the value is knowable but wasn't carried down. Sibling marker 197 (same video, same city) has it.

Also missing district from the same root flow: markers 13 (Jõhvi/Estonia), 98 (Berat/Albania), 198, 199.

Root cause

  1. Legacy from the pre-fix video-edit flow. Before commit 8cd2482 ("Capture and persist country/district when adding video locations") the video-first editor stored only city from the geocode lookup and dropped district/country. Markers 198/199 (and the district-empty rows) were created then; the fix stops new rows but the legacy rows were never backfilled.
  2. Landmarks don't inherit the parent city's country/district. createLocation (src/lib/location-matching.ts:147-160) inserts the landmark with whatever country/district was passed and never falls back to the parent city node's values — so a landmark whose marker lacked a country gets NULL even though findOrCreateCity set the parent city's country. (findOrCreateCity self-heals only the city node, L70-79.)
  3. Representation mismatch compounds it: the marker side stores '' (see Cleared fields persist as '' instead of NULL (dead Zod empty-string transform) #2 — dead Zod empty-string transform) while the landmark stores NULL.

Fix plan (not done — triage only)

  1. Backfill: set country on markers 198/199 and landmarks zqqgo4si/e75wgcw6 from their parent city (Israel); backfill the empty districts where derivable.
  2. Code: in createLocation, fall back to the parent city node's country/district when the landmark's own is missing (inherit from parent), mirroring the existing city-node self-heal.
  3. Depends on Cleared fields persist as '' instead of NULL (dead Zod empty-string transform) #2 (normalize ''→NULL) and relates to Marker city diverges from its location node's city/name (24 rows) #1 (location nodes are write-once).

Note: this video is about Palestine; if the blank country was an intentional editorial choice rather than a data drop, close as wontfix — but it's currently inconsistent with the sibling stop and the parent city, both of which say "Israel".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmedium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions