All problems

Device Import Saves False Text as Enabled

Level 2 · node · Data · Incorrect normalization of boolean strings

Scenario

A fictional building-management service imports device settings from parsed CSV rows and stores the enabled flag. CSV supplies textual true and false values, but the mapper currently treats every nonempty string as truthy. As a result, devices marked 'false' are imported as enabled. Trace conversion from the parsed row through the storage service.

Requirements

Map the string 'true' to true and 'false' to false. Accept surrounding spaces and case differences, but reject any other strings. Preserve actual boolean inputs and store a genuine boolean value.

Acceptance criteria

  • Text true is imported as enabled.
  • Text false is imported as disabled.
  • Whitespace and case variants of false remain disabled.
  • Strings other than true and false are rejected.