fix: correct workflow summary pagination#7392
Merged
sfmskywalker merged 1 commit intoelsa-workflows:release/3.6.1from Apr 15, 2026
Merged
Conversation
Contributor
Author
|
fixes #7391 |
Contributor
Greptile SummaryThis PR fixes a one-line pagination bug in Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/modules/Elsa.Common/Models/PageArgs.cs | Fixes Next() to advance by Offset + Limit instead of the buggy Page + 1; the one-line change is correct and safe. |
| test/unit/Elsa.Common.UnitTests/Models/PageArgsTests.cs | Adds targeted regression tests for Next() covering both the offset-advancing path and the null/unbounded PageArgs.All path; assertions are correct. |
| test/unit/Elsa.Workflows.Runtime.UnitTests/Extensions/WorkflowInstanceStoreExtensionsTests.cs | Integration-style regression test that validates EnumerateSummariesAsync advances through pages 0→2→4 with batchSize=2 and terminates on the empty page; correctly fails against the old buggy Next() formula. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A([Start]) --> B["pageArgs = FromPage(0, batchSize)\n(Offset=0, Limit=batchSize)"]
B --> C{cancellationToken\ncancelled?}
C -- Yes --> Z([End])
C -- No --> D["page = SummarizeManyAsync(filter, pageArgs)"]
D --> E{page.Items\n.Count == 0?}
E -- Yes --> Z
E -- No --> F["yield return each item"]
F --> G["pageArgs = pageArgs.Next()\n✅ Offset = Offset + Limit\n❌ OLD: Offset = Page + 1"]
G --> C
Reviews (1): Last reviewed commit: "fix: correct workflow summary pagination..." | Re-trigger Greptile
sfmskywalker
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Fix pagination advancement for workflow instance summary enumeration on
release/3.6.1. This correctsPageArgs.Next()so paged enumeration advances by a full page instead of getting stuck atOffset = 1.Scope
Description
Problem
WorkflowInstanceStoreExtensions.EnumerateSummariesAsyncadvances pagination by callingpageArgs.Next(). Onrelease/3.6.1,PageArgs.Next()setsOffset = Page + 1, which is incorrect for paged range-based iteration.With a batch size greater than
1, pagination can become stuck atOffset = 1, causing the same page to be requested repeatedly and potentially preventing enumeration from completing.Solution
This change fixes
PageArgs.Next()at the root cause by advancing pagination usingOffset + Limit.It also adds regression tests to verify:
PageArgs.Next()advances by a full page.WorkflowInstanceStoreExtensions.EnumerateSummariesAsyncprogresses across multiple pages without repeating offsets.Verification
Steps:
dotnet test test/unit/Elsa.Common.UnitTests/Elsa.Common.UnitTests.csproj --filter FullyQualifiedName~PageArgsTestsdotnet test test/unit/Elsa.Workflows.Runtime.UnitTests/Elsa.Workflows.Runtime.UnitTests.csproj --filter FullyQualifiedName~WorkflowInstanceStoreExtensionsTestsExpected outcome:
PageArgs.Next()advances from(Offset=0, Limit=10)to(Offset=10, Limit=10)and then(Offset=20, Limit=10).Offset = 1.Checklist