You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TasksHandler::get_all_tasks() deserializes the wrong response shape and silently falls back to an empty Vec for any non-array body — including the API's actual response shape.
Or unwrap the tasks array internally and keep Vec<TaskStateUpdate> return type, but return an explicit CloudError on shape mismatch (no silent fallback).
Option 1 is preferred — exposes the wrapper for callers who want links/pagination, and the canonical types from #64 fall in cleanly.
Acceptance criteria
get_all_tasks() correctly deserializes the wrapper response shape
Mock test with the realistic shape (use tests/fixtures/cloud_openapi.json examples or a fixture file)
No silent empty-Vec fallback — shape mismatches return CloudError::Deserialization
Summary
TasksHandler::get_all_tasks()deserializes the wrong response shape and silently falls back to an emptyVecfor any non-array body — including the API's actual response shape.Expected behavior
Per the OpenAPI spec,
GET /tasksreturns:```json
{
"tasks": [
{ "taskId": "...", "status": "...", ... }
],
"links": [...]
}
```
The Rust side should deserialize this into something like `TasksStateUpdate { tasks: Vec, links: Vec }` and `get_all_tasks` should return `Vec`.
Actual behavior
src/tasks.rs:131-139expects a bare array:```rust
let response: serde_json::Value = self.client.get_raw("/tasks").await?;
match response {
serde_json::Value::Array(arr) => Ok(serde_json::from_value(arr.into())?),
_ => Ok(Vec::new()), // <-- silently swallows the real shape
}
```
For the API's wrapper response (
{tasks: [...], links: [...]}), the match falls through to the empty-Vec branch.Impact
get_all_tasks()returnsOk(vec![])regardless of actual task state. Any caller using this for status polling or auditing is silently blind.Relevant code
src/tasks.rs:131-139tests/fixtures/cloud_openapi.json— search for/tasksGET response →TasksStateUpdateschemaSuggested fix
Either:
TasksStateUpdatewrapper struct, change return type, and document. Aligns with refactor(types): consolidate shared task/tag/link models and normalize task status typing #64 (canonical task types).tasksarray internally and keepVec<TaskStateUpdate>return type, but return an explicitCloudErroron shape mismatch (no silent fallback).Option 1 is preferred — exposes the wrapper for callers who want links/pagination, and the canonical types from #64 fall in cleanly.
Acceptance criteria
get_all_tasks()correctly deserializes the wrapper response shapetests/fixtures/cloud_openapi.jsonexamples or a fixture file)CloudError::Deserializationtasks.rsupdatedReferences