Skip to content

fix: read eventId instead of questionId in myriad normalizer#586

Closed
realfishsam wants to merge 1 commit into
mainfrom
fix/556-myriad-questionid
Closed

fix: read eventId instead of questionId in myriad normalizer#586
realfishsam wants to merge 1 commit into
mainfrom
fix/556-myriad-questionid

Conversation

@realfishsam
Copy link
Copy Markdown
Contributor

Fixes #556

@realfishsam
Copy link
Copy Markdown
Contributor Author

PR Review: FAIL

What This Does

Changes the Myriad normalizer and raw type interface to read eventId instead of questionId from the API response, fixing the event ID mapping in the normalizer.

Blast Radius

  • Myriad exchange: fetcher.ts (raw type interface), normalizer.ts (normalization logic)
  • Affects eventId field on all Myriad UnifiedMarket objects

Findings

  1. BLOCKING: utils.ts not updated -- core/src/exchanges/myriad/utils.ts line 68 still reads market.questionId to populate eventId. This is a parallel normalization path (mapMarketToUnified in utils.ts vs normalizeMarket in normalizer.ts) that will remain broken after this PR. The same questionId -> eventId rename must be applied there.
  2. Raw type update is incomplete -- the MyriadRawMarket interface in fetcher.ts changed questionId to eventId, but the [key: string]: unknown index signature means the old field name still compiles. However, code in utils.ts still references the typed questionId field (which no longer exists on the interface), creating a type inconsistency even though it compiles due to the catch-all index signature.
  3. No test coverage -- no test was added to verify that eventId is correctly populated from the API response.

PMXT Pipeline Check

  • Field propagation: ISSUE -- utils.ts is a second normalization path that was not updated
  • OpenAPI sync: N/A
  • Type safety: ISSUE -- stale questionId reference in utils.ts after interface rename

Semver Impact

patch -- bug fix for incorrect field mapping

Risk

Merging as-is leaves utils.ts broken: Myriad markets normalized through the mapMarketToUnified utility path will have eventId: undefined because market.questionId no longer exists on the raw type (it was renamed to eventId). This is a data correctness issue.

@realfishsam
Copy link
Copy Markdown
Contributor Author

Closing — incomplete fix. Missed utils.ts:68. Will resubmit with complete fix.

@realfishsam realfishsam deleted the fix/556-myriad-questionid branch May 24, 2026 17:06
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: myriad — normalizer reads raw.questionId but live API field is eventId (always null)

1 participant