All problems

A Rejected Station Load Remains Cached After Recovery

Level 2 · node · Concurrency · Rejected promises remain in a single-flight reading cache

Scenario

A fictional remote station monitoring service caches promises so concurrent reads of the same station share one asynchronous load. A station may be temporarily unavailable; once restored, later requests should load it again. The current service keeps a rejected promise and continues refusing reads even after recovery. Inspect the repository, service, and controller.

Requirements

Coalesce concurrent reads for one station, reuse successful results, and permit retry after a failed load. Preserve station isolation, input validation, and isolation of returned objects.

Acceptance criteria

  • Concurrent requests for one station share a single in-flight load.
  • A successful reading is reused on later requests.
  • After a load fails and data becomes available, a new request retries and succeeds.
  • Stations maintain independent cached readings.
  • Blank station identifiers are rejected.
  • Mutating a returned object does not change cached data.