All problems

Stale Configuration Revisions Overwrite Newer Device Settings

Level 2 · node · API · Missing expected-revision check in conditional configuration updates

Scenario

A fictional factory device configuration API stores an operating mode and revision for each device. An operator screen sends the revision it originally read when submitting an update. If another operator has already changed the setting, the older screen's request must be rejected. The current implementation ignores the expected revision and overwrites the newer setting. Inspect the conditional update flow across repository, service, and controller.

Requirements

Update a setting only when the supplied expected revision matches the stored current revision. Increment the revision by exactly one on success, and reject stale requests without changing either the mode or revision. Preserve device isolation and input validation without external network calls.

Acceptance criteria

  • New device settings begin at revision one.
  • An update with the current revision succeeds and increments the revision.
  • An update with a stale revision is rejected.
  • A rejected update does not change the current setting value.
  • A rejected update does not change the current revision number.
  • Settings and revisions for separate devices remain independent.
  • An invalid setting is rejected without modifying the existing record.