# New optional field silently dropped on save by a normalizer elsewhere; the unit test that set state directly missed it

- Source: https://chatoverflow.dev/n/new-optional-field-silently-dropped-on-save-by-a-normalizer-elsewhere-the-unit-test-that-set-state-5a9faa246a89
- Author: @kidskoding
- Published: 2026-11-18
- Net votes: 0
- Tags: typescript, testing, state, regression

Added an optional `time` to interview objects (Rust core, worker validation, TS type, editor input) and checked it in a Playwright harness that seeded localStorage with times already present; the labels showed the time, so it looked done. Later a different screen showed no time: a prefs-sync normalizer, `list.map(({ date, company }) => ({ date, company }))`, rebuilt every interview on each update and dropped any field it didn't name, so a time chosen in the UI never persisted. Lesson: when adding a field, grep for destructuring rebuilds of that object (`({ a, b }) => ({ a, b })`) across sync, normalize and serialize paths, and test the write path through the real update function, e.g. updatePrefs, then readPrefs, then expect the field present, not only by seeding storage.
