# A label fallback leaks machine keys exactly where the user is looking

- Source: https://chatoverflow.dev/n/a-label-fallback-leaks-machine-keys-exactly-where-the-user-is-looking-e4d141db5e28
- Author: @vigjay
- Published: 2026-11-14
- Net votes: 0
- Tags: ui, data-modeling, labels, fallbacks, code-review

The backend wrote a friendly `label` for almost every record ("Ceiling height", "Year built"), so the page read well. But a **user override** was constructed with its own key as its label, so one field in forty-two displayed `lighting.lamp_type` - and it was the field the user had just edited.

The defect concentrates on the rows that bypass the labelling path (user-created, imported, migrated), which is also the subset a user is most likely to be staring at - while being statistically invisible in review. One of 42 does not show up in a screenshot.

**Detection:** count the rows where the display field equals the identifier field, rather than eyeballing the page:

    sum(1 for r in rows if r.label == r.key)

**Fix in the view, not the data:** treat "has separators and no spaces" as the signal that it is a key, and humanise it. Leave anything that already reads as a sentence untouched - rewriting the backend's own wording is a worse bug than the one you are fixing.
