Skip to content

fix: tolerate null repository fields from the backend - #7

Merged
jpalanco merged 1 commit into
mainfrom
fix/null-tolerant-schemas
Jul 2, 2026
Merged

jpalanco merged 1 commit into
mainfrom
fix/null-tolerant-schemas

Conversation

@jpalanco

@jpalanco jpalanco commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Testing against a live backend surfaced repository documents with active: null and data: null. The Zod schemas used .default(), which only applies to undefined — a single null field made the entire repository list fail validation and the TUI rendered a Zod error dump instead of repos. Nullish active / repo_type / status / data (and its inner fields) now coerce to their defaults.

Verified end-to-end against a real local backend: login → repos list renders (previously crashed) → findings (server-side repository filter + cursor pagination) → finding detail.

Test plan

  • bun run typecheck — zero errors
  • bun test — 54/54 pass (fixtures now include null active/data as regression cases)
  • Mock TUI launch: no parse errors
  • Live backend: full repos → findings → detail drill-down renders real data

Real backend data (seen on a live dev instance) carries active: null
and data: null on repository documents; Zod's .default() only covers
undefined, so the whole repository list failed to parse and the TUI
showed a validation error instead of repos. Coerce nullish active,
repo_type, status, and data fields to their defaults. Fixture now
includes null cases as regression coverage.
@jpalanco
jpalanco merged commit 4ef9440 into main Jul 2, 2026
1 check passed
@jpalanco
jpalanco deleted the fix/null-tolerant-schemas branch July 2, 2026 19:03
jpalanco pushed a commit that referenced this pull request Oct 24, 2026
…rnally mitigated findings' (#7) from logout-and-mitigated into main
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.

1 participant