All problems

Thermal Archive Pages Report Page Size as Total Count

Level 2 · node · Data · Incorrect total-count metadata in paginated history responses

Scenario

A fictional building thermal-monitoring system returns temperature readings by site in pages. Its dashboard needs both the selected page and the total number of records to calculate navigation. The current implementation reports the number of returned rows as the total, making a large history appear to have only one page. Inspect the repository, service, and controller response flow.

Requirements

Return the complete number of readings for the requested site independently of the selected page. Offset and limit must affect only the returned rows, not the total. Preserve insertion order, site isolation, empty-site behavior, and invalid pagination rejection.

Acceptance criteria

  • The first page returns the requested number of readings in order.
  • The next page starts at the correct offset.
  • The total equals all records for the site regardless of offset or limit.
  • An empty site returns an empty list and total zero.
  • Readings from separate sites remain isolated.
  • Invalid pagination parameters are rejected.