Harden the vikunja client and sync against malformed responses #12

Closed
opened 2026-08-14 22:56:23 +00:00 by gravityfargo · 0 comments
Owner

Deferred review findings from the vikunja-project-sync implementation (all approved-with-notes, none blocking):

  • common/vikunja.py projects() trusts the parsed body to be a list; a malformed 2xx (proxy quirk, API drift) silently corrupts the accumulated result instead of raising RestAdapterError.
  • The pagination walk has no upper bound: a server always answering exactly per_page items loops forever. A generous page cap turning the hang into a clear error is enough.
  • project/sync.py _ensure_parent resolves via by_parent_title.get(...) or client.create_project(...) while _resolve_child uses an explicit is not None check; align on the latter so a falsy-but-present dict can never trigger a spurious create.
  • RestAdapter.put has no error-path test, unlike get/post (coverage holds via the shared _request, symmetry only).
Deferred review findings from the vikunja-project-sync implementation (all approved-with-notes, none blocking): - `common/vikunja.py` `projects()` trusts the parsed body to be a list; a malformed 2xx (proxy quirk, API drift) silently corrupts the accumulated result instead of raising `RestAdapterError`. - The pagination walk has no upper bound: a server always answering exactly `per_page` items loops forever. A generous page cap turning the hang into a clear error is enough. - `project/sync.py` `_ensure_parent` resolves via `by_parent_title.get(...) or client.create_project(...)` while `_resolve_child` uses an explicit `is not None` check; align on the latter so a falsy-but-present dict can never trigger a spurious create. - `RestAdapter.put` has no error-path test, unlike `get`/`post` (coverage holds via the shared `_request`, symmetry only).
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gravityfargo/local-tools#12
No description provided.