Skip to content

fix(rest): read status=TASK_STATE_UNSPECIFIED as no filter - #488

Merged
muscariello merged 1 commit into
mainfrom
stack/20-rest-status-unspecified-no-filter
Nov 4, 2026
Merged

muscariello merged 1 commit into
mainfrom
stack/20-rest-status-unspecified-no-filter

Conversation

@muscariello

Copy link
Copy Markdown
Member

Fixes #482. Replaces #483.

Cause: the REST binding turned status=TASK_STATE_UNSPECIFIED into a filter no task matches, while JSON-RPC and gRPC read the proto default as "no filter" (pbconv.rs). One ListTasks answered every task on one binding and none on another (§5.1).

Fix: handle_list_tasks maps TaskState::Unspecified to None. Unknown values are still refused with "invalid status filter".

Tests: test_list_tasks_status_unspecified_is_no_filter: after one POST /message:send, GET /tasks?status=TASK_STATE_UNSPECIFIED reports totalSize: 1; on main it reports 0.

Unproven: not built together with #468 (open), which changes this handler's extractor; the two merge without conflict.

@muscariello
muscariello requested a review from a team as a code owner November 3, 2026 19:54
@muscariello
muscariello added this pull request to stack #492 November 3, 2026 19:55
@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@muscariello
muscariello force-pushed the stack/20-rest-status-unspecified-no-filter branch from 00cc8fe to 67df77b Compare November 3, 2026 20:52
@muscariello
muscariello requested a review from lgecse November 3, 2026 22:22
@muscariello
muscariello force-pushed the stack/20-rest-status-unspecified-no-filter branch from 67df77b to 2e2427c Compare November 3, 2026 22:39
@muscariello
muscariello force-pushed the stack/20-rest-status-unspecified-no-filter branch from 2e2427c to 9ff0a1f Compare November 4, 2026 08:16
TASK_STATE_UNSPECIFIED is the proto default for an unset status, and the
JSON-RPC and gRPC bindings read it as "no filter". The REST binding
passed it on as a filter, so GET /tasks?status=TASK_STATE_UNSPECIFIED
matched no task at all while the same ListTasks over JSON-RPC returned
every task.

Signed-off-by: gulldan <5641375+gulldan@users.noreply.github.com>
@muscariello
muscariello force-pushed the stack/20-rest-status-unspecified-no-filter branch from 9ff0a1f to 7a3d8e5 Compare November 4, 2026 11:57
@muscariello
muscariello added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit d81e935 Nov 4, 2026
22 checks passed
@muscariello
muscariello deleted the stack/20-rest-status-unspecified-no-filter branch November 4, 2026 14:20
@github-actions github-actions Bot mentioned this pull request Nov 4, 2026
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.

[Bug]: REST ListTasks treats status=TASK_STATE_UNSPECIFIED as a filter that matches nothing

3 participants