Skip to content

Changelog - 2026-09-06

List headers from an offset and a total

New Feature

In one line. A route whose engine reports offset and total instead of a TDataRange now calls setListHeaders directly, and nobody formats Content-Range by hand again.

typescript
this.setListHeaders({ context, offset, total, count: hits.length });
return context.json({ found, isFoundExact, hits });

The problem it solves

setListHeaders took only a repository TDataRange. A search engine answers with an offset and a total, so search routes rebuilt the header string themselves: three copies of the same five lines in one consumer, each a place for the inclusive-end rule to drift.

What changed

SymbolChangePackage
BaseRestController.setListHeaders()Options are { context, count } plus either { range } or { offset, total }; the second form derives the range with buildDataRangekernel
toContentRange({ range, count })Exported from @venizia/ignis-kernel (was module-private)kernel
  • An empty page still writes records */<total>.
  • respond() is unchanged; use it when the body is the { count, data } envelope.

Who is affected

  • Routes that write Content-Range themselves. Replace the formatting with setListHeaders({ context, offset, total, count }), or toContentRange when only the string is needed.
  • Everyone else. No action needed.

Details