Skip to content

fix: handle missing image_url in kalshi event normalizer#592

Merged
realfishsam merged 1 commit into
mainfrom
fix/442-kalshi-event-image
May 24, 2026
Merged

fix: handle missing image_url in kalshi event normalizer#592
realfishsam merged 1 commit into
mainfrom
fix/442-kalshi-event-image

Conversation

@realfishsam
Copy link
Copy Markdown
Contributor

Fixes #442

@realfishsam
Copy link
Copy Markdown
Contributor Author

PR Review: VERIFIED

What This Does

Fixes the Kalshi event normalizer to handle a missing image_url field by coercing null to undefined via the nullish coalescing operator. Previously, a null value from the API would propagate as null into UnifiedEvent.image, which is typed as string | undefined (not string | null).

Blast Radius

  • core/src/exchanges/kalshi/normalizer.ts -- single line change in normalizeEvent

Findings

No blocking findings. The change is correct: raw.image_url ?? undefined converts null to undefined while passing through valid strings unchanged. This aligns with the image?: string type on UnifiedEvent.

PMXT Pipeline Check

  • Field propagation: N/A (no new fields)
  • OpenAPI sync: N/A
  • Type safety: OK (fixes a null-vs-undefined type mismatch)

Semver Impact

patch -- bug fix for null handling.

Risk

None. Single-line, narrowly scoped fix.

@realfishsam realfishsam merged commit 9fb58ce into main May 24, 2026
11 of 12 checks passed
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.

Response drift: kalshi — event.image_url absent from live /events response, no fallback

1 participant