Skip to content

Optimize event and stack paging totals#2316

Draft
ejsmith wants to merge 4 commits into
mainfrom
paging-include-total
Draft

Optimize event and stack paging totals#2316
ejsmith wants to merge 4 commits into
mainfrom
paging-include-total

Conversation

@ejsmith

@ejsmith ejsmith commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds an include=total query option to event list endpoints so cursor paging can opt into total metadata only when needed.
  • Updates event and stack pages to request totals only when they are useful for stable initial pagination metadata.
  • Replaces stack total calculation based on sum_other_doc_count with an optional stack_id cardinality aggregation, and preserves known table page counts when later offset responses omit totals.
  • Updates the Foundatio.Repositories.Elasticsearch package to 8.0.0-beta2 without using PIT.

Root Cause

Event paging was asking Elasticsearch for exact totals on every before/after request and still returning X-Result-Count on cursor hops. Stack paging was also deriving a stack total from terms aggregation spillover document counts, which is not a stable distinct stack count.

Validation

  • dotnet restore src/Exceptionless.Web/Exceptionless.Web.csproj
  • dotnet build src/Exceptionless.Web/Exceptionless.Web.csproj -p:UseSharedCompilation=false -p:BuildInParallel=false --no-restore
  • dotnet build tests/Exceptionless.Tests/Exceptionless.Tests.csproj -p:UseSharedCompilation=false -p:BuildInParallel=false --no-restore
  • UPDATE_SNAPSHOTS=true dotnet test tests/Exceptionless.Tests/Exceptionless.Tests.csproj -- --filter-class Exceptionless.Tests.Controllers.OpenApiControllerTests
  • dotnet test tests/Exceptionless.Tests/Exceptionless.Tests.csproj -- --filter-class Exceptionless.Tests.Controllers.OpenApiControllerTests
  • npm run check
  • npm run test:unit -- src/lib/features/shared/table.test.ts
  • git diff --check
  • UPDATE_SNAPSHOTS=true dotnet test tests/Exceptionless.Tests/Exceptionless.Tests.csproj -- --filter-class Exceptionless.Tests.Controllers.OpenApiControllerTests
  • dotnet test tests/Exceptionless.Tests/Exceptionless.Tests.csproj -- --filter-class Exceptionless.Tests.Controllers.OpenApiControllerTests
  • dotnet build src/Exceptionless.Web/Exceptionless.Web.csproj -p:UseSharedCompilation=false -p:BuildInParallel=false --no-restore
  • npm run check

Notes

  • PIT is intentionally not used because there is not a reliable cleanup path and it is not required for this change.
  • Missing include does not include total metadata; clients must pass include=total when they need X-Result-Count.
  • Aspire was started locally and reported the API and Svelte app healthy on dynamic ports.

@ejsmith ejsmith marked this pull request as ready for review June 20, 2026 05:04
@ejsmith

ejsmith commented Jun 20, 2026

Copy link
Copy Markdown
Member Author

/preview

@github-actions github-actions Bot added the dev-preview Deploy this pull request to the shared dev environment. label Jun 20, 2026
@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown

Preview deployed

@ejsmith ejsmith marked this pull request as draft June 21, 2026 01:53
@ejsmith ejsmith marked this pull request as ready for review June 21, 2026 01:57
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.AppHost 39% 40% 134
Exceptionless.Core 70% 63% 7967
Exceptionless.Insulation 24% 23% 203
Exceptionless.Web 72% 61% 4147
Summary 69% (14207 / 20566) 61% (7370 / 11994) 12451

@ejsmith ejsmith marked this pull request as draft June 21, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-preview Deploy this pull request to the shared dev environment.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant