Logs: a total only when it's known, not the query cap #117

Merged
jcoffey-dev merged 1 commits from fix/log-query-total into main 2026-09-29 05:00:18 +00:00
Owner

The Logs page read "Showing 1-2 of 5000" for a two-line log.

The cause: log_query built its response with the query cap (query_max_results, 5000) as the total, so calculateTotal always answered 5000.

The fix: the total is only known without extra work when the first page reaches the end of the logs. Then it's exact. Past the first page, or when there are more entries than the limit, the total is left out; counting would mean reading every log file on every page. An empty log now answers 0.

Checked: against a local server with a log tracer:

  • 5 entries with limit 50 gives ids 5, total 5;
  • limit 3 gives ids 3, no total;
  • an empty log gives total 0.

The console change that pages without a total is the admin PR that follows.

The Logs page read "Showing 1-2 of 5000" for a two-line log. **The cause:** `log_query` built its response with the query cap (`query_max_results`, 5000) as the total, so `calculateTotal` always answered 5000. **The fix:** the total is only known without extra work when the first page reaches the end of the logs. Then it's exact. Past the first page, or when there are more entries than the limit, the total is left out; counting would mean reading every log file on every page. An empty log now answers 0. **Checked:** against a local server with a log tracer: - 5 entries with limit 50 gives ids 5, total 5; - limit 3 gives ids 3, no total; - an empty log gives total 0. The console change that pages without a total is the admin PR that follows.
jcoffey-dev added 1 commit 2026-09-29 04:43:05 +00:00
Logs: a total only when it's known, not the query cap
ci / fork-checks (pull_request) Successful in 55s
ci / build (pull_request) Successful in 17m3s
9c29fb2bea
jcoffey-dev merged commit 6ee7ba1b7e into main 2026-09-29 05:00:18 +00:00
jcoffey-dev deleted branch fix/log-query-total 2026-09-29 05:00:19 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: inbuxa/inbuxa-server#117