Drift
Given a UnifiedMarket/UnifiedEvent object with both an ID and a slug populated, fetchMatchedMarketClusters/fetchMatchedEventClusters derive the query key with opposite preference in each language — and TypeScript's own preference here contradicts its sibling method fetchMarketMatches.
TypeScript SDK
sdks/typescript/pmxt/router.ts:394-396 (fetchMatchedMarketClusters):
const marketId = params.marketId ?? params.market?.marketId;
const slug = params.slug ?? (!marketId ? params.market?.slug : undefined);
marketId is computed first and always taken from params.market.marketId if present; slug is only pulled from params.market.slug when no marketId exists. Same pattern for events at router.ts:427-429.
Contrast with the sibling fetchMarketMatches, sdks/typescript/pmxt/router.ts:259:
const marketId = params.marketId ?? (!params.market?.slug ? params.market?.marketId : undefined);
Here slug is preferred — marketId is only pulled from params.market.marketId when no slug exists.
Python SDK
sdks/python/pmxt/router.py:352-356 (fetch_matched_market_clusters):
if market is not None and market_id is None:
if hasattr(market, "slug") and market.slug:
slug = slug or market.slug
else:
market_id = market.market_id
Prefers slug over market_id, matching fetch_market_matches's own preference. Same for events at router.py:407-411.
Expected
TypeScript's fetchMatchedMarketClusters/fetchMatchedEventClusters should prefer slug over marketId/eventId, matching both Python's behavior and TypeScript's own fetchMarketMatches.
Impact
Passing the same UnifiedMarket/UnifiedEvent object (with both an ID and slug populated) into fetchMatchedMarketClusters/fetchMatchedEventClusters yields a marketId/eventId-keyed query in TypeScript but a slug-keyed query in Python — potentially different cluster results if the backend's ID and slug indexes aren't perfectly synchronized. TypeScript additionally contradicts itself between fetchMarketMatches and fetchMatchedMarketClusters for the identical input shape.
Found by automated SDK cross-language drift audit
Drift
Given a
UnifiedMarket/UnifiedEventobject with both an ID and aslugpopulated,fetchMatchedMarketClusters/fetchMatchedEventClustersderive the query key with opposite preference in each language — and TypeScript's own preference here contradicts its sibling methodfetchMarketMatches.TypeScript SDK
sdks/typescript/pmxt/router.ts:394-396(fetchMatchedMarketClusters):marketIdis computed first and always taken fromparams.market.marketIdif present;slugis only pulled fromparams.market.slugwhen nomarketIdexists. Same pattern for events atrouter.ts:427-429.Contrast with the sibling
fetchMarketMatches,sdks/typescript/pmxt/router.ts:259:Here
slugis preferred —marketIdis only pulled fromparams.market.marketIdwhen no slug exists.Python SDK
sdks/python/pmxt/router.py:352-356(fetch_matched_market_clusters):Prefers
slugovermarket_id, matchingfetch_market_matches's own preference. Same for events atrouter.py:407-411.Expected
TypeScript's
fetchMatchedMarketClusters/fetchMatchedEventClustersshould preferslugovermarketId/eventId, matching both Python's behavior and TypeScript's ownfetchMarketMatches.Impact
Passing the same
UnifiedMarket/UnifiedEventobject (with both an ID andslugpopulated) intofetchMatchedMarketClusters/fetchMatchedEventClustersyields amarketId/eventId-keyed query in TypeScript but aslug-keyed query in Python — potentially different cluster results if the backend's ID and slug indexes aren't perfectly synchronized. TypeScript additionally contradicts itself betweenfetchMarketMatchesandfetchMatchedMarketClustersfor the identical input shape.Found by automated SDK cross-language drift audit