Skip to content

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

Merged
realfishsam merged 2 commits into
mainfrom
fix/556-myriad-eventid-v2
May 24, 2026
Merged

fix: read eventId instead of questionId in myriad normalizer#602
realfishsam merged 2 commits into
mainfrom
fix/556-myriad-eventid-v2

Conversation

@realfishsam
Copy link
Copy Markdown
Contributor

Fixes #556

@realfishsam
Copy link
Copy Markdown
Contributor Author

PR Review: FAIL

What This Does

Renames questionId to eventId across three Myriad files to match the current live API response shape. This is v2 of PR #586, which missed utils.ts:68.

The three changes:

  1. fetcher.ts:20 -- MyriadRawMarket interface field renamed from questionId to eventId
  2. normalizer.ts:42 -- normalizeMarket() now reads raw.eventId instead of raw.questionId
  3. utils.ts:68 -- mapMarketToUnified() now reads market.eventId instead of market.questionId (the line v1 missed)

Blast Radius

  • Contained to core/src/exchanges/myriad/ -- three files, one line each.
  • No other exchanges are affected. The questionId references in metaculus/, hyperliquid/, and opinion/ are venue-specific and unrelated.
  • The MyriadRawMarket type is consumed by normalizer.ts and utils.ts -- both are updated.
  • mapMarketToUnified in utils.ts is called from mapQuestionToEvent (same file, line 90). No callers from index.ts or other modules.
  • No SDK-layer changes needed -- this fix is at the raw data ingestion layer, before the pipeline reaches OpenAPI or SDK shims.

Findings

Test regression (blocking): The existing test fixture in core/test/normalizers/exchange-normalizers-2.test.ts:414 still sets questionId: 7 on the MyriadRawMarket fixture. Because the interface now has [key: string]: unknown, TypeScript won't flag this -- but the normalizer now reads raw.eventId, which is undefined in the fixture. The test at line 452 ("sets eventId from questionId") will fail:

Expected: '7'
Received: undefined

Fix: change the fixture from questionId: 7 to eventId: 7, and update the test description from "sets eventId from questionId" to "sets eventId from eventId" or similar.

PMXT Pipeline Check

  • Venue normalizer: Updated (normalizer.ts + utils.ts)
  • OpenAPI schema: Not affected (eventId is already in the UnifiedMarket schema)
  • SDK shims: Not affected (no change to the unified output shape)

Semver Impact

patch -- bug fix only, no public API changes.

Risk

LOW with the test fix. The eventId field in the live Myriad API is currently always null per #556, so this change makes the code read the correct (albeit empty) field. No behavioral regression for end users.

Missed in initial fix — test fixture still used questionId.
@realfishsam realfishsam merged commit 1ebfd93 into main May 24, 2026
9 of 12 checks passed
@realfishsam realfishsam deleted the fix/556-myriad-eventid-v2 branch May 24, 2026 17:04
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