Priority order
Order: 02 of 09
Priority: P1 correctness
Problem
Async paged reads can loop forever when the configured page size is 0 and the result set is empty.
Evidence:
src/NEventStore.Persistence.Sql/SqlDialects/CommonDbStatement.cs:331
- Continuation condition is
while (Dialect.CanPage && recordsRead == PageSize).
SqlPersistenceEngine allows PageSize == 0, where zero represents infinite page size.
Impact
- Empty async reads can hang for pageable dialects.
- Affected APIs include checkpoint reads, bucket-scoped reads, and stream reads that call
ExecutePagedQueryAsync.
Mandatory test-first workflow
- Add tests first that reproduce or verify the issue before changing production code.
- Include an async empty-result test with configured page size
0.
- Cover at least
GetFromAsync(0, observer, token) and one bucket-scoped async read.
- The test must fail or time out before the fix and complete after the fix.
Proposed action
- Base continuation on the computed local
pageSize.
- Continue only when
pageSize > 0 && recordsRead == pageSize.
Acceptance criteria
- Empty async reads complete when
PageSize == 0.
- Multi-page async reads still return ordered, complete results when
PageSize > 0.
- Sync behavior is unchanged.
Source: docs/Project-Analysis-Issue-Drafts.md.
Priority order
Order: 02 of 09
Priority: P1 correctness
Problem
Async paged reads can loop forever when the configured page size is
0and the result set is empty.Evidence:
src/NEventStore.Persistence.Sql/SqlDialects/CommonDbStatement.cs:331while (Dialect.CanPage && recordsRead == PageSize).SqlPersistenceEngineallowsPageSize == 0, where zero represents infinite page size.Impact
ExecutePagedQueryAsync.Mandatory test-first workflow
0.GetFromAsync(0, observer, token)and one bucket-scoped async read.Proposed action
pageSize.pageSize > 0 && recordsRead == pageSize.Acceptance criteria
PageSize == 0.PageSize > 0.Source:
docs/Project-Analysis-Issue-Drafts.md.