Unexpected results returned from the SDK
Error
The SDK is returning unexpected results or throwing exceptions (e.g., NameGenerationException) that were not anticipated by the user, despite data being present in the SDK or successful API calls.
Symptoms
Unexpected data: Received from the SDK, contrary to the expected correct data from the API.
For example:
Returning untranslated data: Expecting translated SportEvent data but receiving data in English.
Stale cache issue: SportEvent is associated with outdated competitor IDs due to stale cache items, despite the IDs being updated on the API side.
Unexpected Exceptions: The SDK throws unexpected exceptions (e.g.
NameGenerationException) indicating missing market descriptions despite outcomes being present in OddsChange messages.
Resolution
To address these issues, follow these resolution steps:
SDK philosophy is to never introduce new data points, but to just convert XML data returned by the API or Feed to classes.
Identify Data Source: Determine whether the data is originating from an endpoint or feed message. Most data from the API is cached within the SDK, so REST logs can provide insights. Keep in mind that there might be a delay (few minutes or hours) between API requests and data retrieval from the SDK due to caching.
Inspect REST Logs: Check the REST logs for API calls and responses. Look back in the logs (up to 12 hours depending on the cache) to verify recent data retrievals. Consider deleting cached items (using
SportDataProviderorMarketDescriptionManager) to force immediate API calls for specific data. When the SDK is requested for data associated with that item, it will immediately trigger a new API call. However, not all caches have the capability to remove stored data.Debugging with Logs: Use
traffic.logandrest.logfiles for debugging. These logs contain API call details and data responses retrieved (API XML body are logged only when DEBUG level is enabled).
Important
The vast majority of data which is exposed through the SDK is retrieved from the API, so it must then be available in the rest.log file. The question is often "when was the last time the data was fetched". But with enough amount of logs and using search capabilities of text editing tools and having entity id (e.g. sport event id) and searching for relevant endpoint (e.g. summary.xml or another endpoint) invocations for this entity id, that is also relatively easy to answer as well. And the line found in logs contains all the data retrieved from the API.
Retry Mechanism: Since SDK is backed by API calls, SDK methods may fail. Implement a retry mechanism in the customer's implementation.
Last updated
Was this helpful?