All problems

Messages Exactly at the Query Start Are Omitted

Level 2 · node · API · Exclusive comparison at inclusive start boundary

Scenario

A fictional operations notification service queries messages in a requested time interval. The API contract requires a half-open interval: include the start instant and exclude the end instant. The implementation incorrectly drops a message created exactly at the start time.

Requirements

Return messages whose creation time is greater than or equal to start and strictly less than end. Include records exactly at start, exclude records exactly at end, preserve existing order, and return an empty array when nothing matches.

Acceptance criteria

  • A message exactly at the start time is returned.
  • A message strictly inside the interval is returned.
  • A message exactly at the end time is excluded.
  • An interval with no matching messages returns an empty list.