-
-
Notifications
You must be signed in to change notification settings - Fork 225
Conversation
realfishsam
commented
Jun 21, 2026
Targeted local verification for this focused SuiBets response-drift fix is green:
npm test -- --runTestsByPath test/normalizers/suibets-normalizer.test.ts test/exchanges/suibets-fetcher.test.ts --runInBandgit diff --checknpm run build --workspace=pmxt-core
The current red generated-sync checks appear to be pre-existing/broad drift unrelated to this PR's SuiBets files. Example from Verify API_REFERENCE.md files are up-to-date: regenerated docs want sourceExchange / exchange filter docs and remove TS question, none of which are touched by this branch. Keeping this PR scoped per generated-drift policy rather than folding broad docs/client regeneration into a SuiBets hotfix.
realfishsam
commented
Jun 21, 2026
PR Review: FAIL
What This Does
Adds compatibility for current SuiBets offer payloads that use eventId, eventName, and sportName instead of the older matchId, matchName, and sport fields. This matters to SDK consumers because fetchMarkets/fetchEvents should continue returning populated event IDs, market titles/descriptions, and tags as the venue response shape drifts.
Blast Radius
Core SuiBets fetcher and normalizer only, plus focused SuiBets regression tests. No OpenAPI schema, SDK shim, router, auth, or generated SDK files are changed.
Consumer Verification
Before (base branch):
Not run separately; this is a bug-fix/static drift PR and the old implementation only looked at the legacy match* / sport field names in the affected paths.
After (PR branch):
The new event grouping path works for renamed fields (eventId/eventName/sportName) in the PR's focused test, but the market search/filter consumer path still drops renamed-field offers. I ran a focused consumer-path probe against SuibetsFetcher.fetchRawMarkets({ query: 'baseball' }) with an offer containing only eventName: 'Mets vs Yankees' and sportName: 'Baseball':
Expected length: 1
Received length: 0
Received array: []
So an SDK consumer searching SuiBets markets by the current sportName or eventName fields still receives no markets.
Test Results
- Build: PASS (
npm run build --workspace=pmxt-core) - Unit tests: PASS (60 passed, 0 failed:
test/normalizers/suibets-normalizer.test.ts,test/exchanges/suibets-fetcher.test.ts) - Server starts: PASS (
GET /healthsucceeded on local sidecar) - E2E smoke: FAIL (focused fetcher probe for renamed-field market query returns
[])
Findings
core/src/exchanges/suibets/fetcher.ts:143--fetchRawMarketsstill filtersparams.queryonly againstmatchName,homeTeam,awayTeam, andsport. The PR adds renamed-field support elsewhere, but this consumer path omitseventNameandsportName, so current SuiBets offers are excluded when users search by event/sport. Concrete repro on the PR branch:fetchRawMarkets({ query: 'baseball' })with an offer containingsportName: 'Baseball'returned[]instead of the offer.
PMXT Pipeline Check
- Field propagation (3-layer): N/A — no unified field/schema addition
- OpenAPI sync: N/A
- Financial precision: OK — no new price/amount arithmetic beyond existing MIST conversion
- Type safety: ISSUE — renamed fields are modeled, but not consumed consistently in
fetchRawMarketsquery filtering - Auth safety: N/A
Semver Impact
patch -- venue response-drift bug fix.
Risk
The event grouping and normalizer paths are covered, but market query filtering remains inconsistent. If merged as-is, consumers using fetchMarkets({ query }) can still miss SuiBets markets whose current payloads no longer include matchName/sport.
Summary
eventId,eventName, andsportNamefields alongside the oldermatchId,matchName, andsportnames.matchIdis absent and keeps normalized market titles/descriptions/tags populated.Fixes #1208
Fixes #1209
Fixes #1210
Test Plan
npm test -- --runTestsByPath test/normalizers/suibets-normalizer.test.ts test/exchanges/suibets-fetcher.test.ts --runInBand(fromcore/)git diff --checknpm run build --workspace=pmxt-core