Skip to content

fix: complete task paging, filters and parent handling - #241

Merged
stefan-ernst merged 3 commits into
Windshiftapp:mainfrom
Optic00:codex/cli-usability-complete
Sep 7, 2026
Merged

fix: complete task paging, filters and parent handling#241
stefan-ernst merged 3 commits into
Windshiftapp:mainfrom
Optic00:codex/cli-usability-complete

Conversation

@Optic00

@Optic00 Optic00 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Make task listing explicit about pagination: --page, --limit and --all support complete retrieval, preserve filters and reject inconsistent page responses. Table/CSV output warns on stderr when results are partial.

Status names resolve in the selected workspace, including negation. Milestone names require an exact, unambiguous workspace match across all pages. Parent keys work in create/edit; task edit --parent 0 sends JSON null to remove the parent, while omission preserves it.

Verified: the complete external CLI test package, focused task tests with the race detector, CLI go vet and go test ./cmd/ws. Real HTTP regression tests on SQLite verify persisted parent removal and preservation, not just a stub response. These tests are on the companion test branch, whose wider migration remains incomplete.

@Optic00 Optic00 changed the title fix(cli): complete task paging, filters and parent handling fix: complete task paging, filters and parent handling Sep 7, 2026
@stefan-ernst

stefan-ernst commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Hey @Optic00 - thanks!

I'm ready to merge that one in as part of 0.8.8, I just found a minor issue:

if page >= response.Pagination.TotalPages {
if combined == nil {
combined = []Item{}
}
return &PaginatedResponse[Item]{
Data: combined,
Pagination: PaginationMeta{
Page: 1,
PageSize: len(combined),
TotalItems: len(combined),
TotalPages: 1,
},
}, nil
}

if len(combined) == before {
return nil, fmt.Errorf(
"pagination made no progress on page %d; retry the query", page,
)
}

the second condition here should come before the first return, like this:

if page >= response.Pagination.TotalPages {
if len(combined) != response.Pagination.TotalItems {
return nil, fmt.Errorf(
"incomplete pagination: received %d of %d items; retry the query",
len(combined), response.Pagination.TotalItems,
)
}
...
}

@Optic00

Optic00 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Fixed: --all now checks the number of unique collected items against the final response's total_items before returning success. An incomplete result returns an error without partial output.

The new regression reproduces the original bug and covers empty, duplicate, partial and overfull final pages, plus complete results with and without overlap. The complete CLI package passes with the race detector; go vet passes too.

@stefan-ernst
stefan-ernst merged commit fbc9fd8 into Windshiftapp:main Sep 7, 2026
19 checks passed
@Optic00
Optic00 deleted the codex/cli-usability-complete branch September 12, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants