Skip to main content

Troubleshooting

Overview

Our SDKs have a standardized interface for inputs to every method. If you have issues getting up and running with any of our SDKs or aren't getting the expected return from any method or to the Split UI, you can find a detailed view of the types of validation that our SDK performs for each method below.

Below are the expected input data types for the method getTreatment(key, split_name, attributes):

  • key: string that is less than or equal to 250 characters
  • split_name: string
  • attributes: dictionary
info

For iOS, Android, and JavaScript, this method also has a signature of getTreatment(split_name, attributes). If you are troubleshooting any of these SDKs, feel free to skip the Key Validations section below.

Key Validations

key == null || key undefined (or similar for each language) SDK will return control SDK will log the following error to the console “getTreatment: you passed a null or undefined key, the key must be a non-empty string” no Impression will be logged back to Split servers key is longer than 250 characters SDK will return control SDK will log the error “getTreatment: key too long - must be 250 characters or less” no Impression will be logged back to Split servers key is of type number and is finite SDK will perform best effort to stringify the input and return a treatment for the converted response SDK will log the error “getTreatment: key too long - must be 250 characters or less” key is not of type string or finite number or object type SDK will return control SDK will log the error “getTreatment: you passed an invalid key type, key must be a non-empty string” no Impression will be logged back to Split servers key is an empty string SDK will return control SDK will log the error “getTreatment: you passed an empty string, key must be a non-empty string” no Impression will be logged back to Split servers

Split Name Validations

split_name == null || undefined SDK will return control SDK will log the error “getTreatment: you passed a null or undefined split name, split name must be a non-empty string” no Impression will be logged back to Split servers split_name is not of type string SDK will return control SDK will log the error “getTreatment: you passed an invalid split name, split name must be a non-empty string” no Impression will be logged back to Split servers split_name is an empty string SDK will return control SDK will log the error “getTreatment: you passed an invalid split name, split name must be a non-empty string” no Impression will be logged back to Split servers split_name has whitespace at the end or beginning of the string SDK will evaluate with the trimmed version of the split name. SDK will log the warning “getTreatment: split name “X” has extra whitespace, trimming” An Impression will be logged with the trimmed split_name.

Attributes Validations

attributes is not of type dictionary SDK will return control SDK will log the error “getTreatment: attributes must be of type dictionary” no Impression will be logged back to Split servers

Validation for a Destroyed Client

Below is the behavior you can expect from the client if it is used after it has been destroyed:

All methods will log the error “Client has already been destroyed - no calls possible” Any calls to getTreatment and getTreatments will return control or map of controls Any calls to track will return false Any manager methods will return null or an empty collection

Tracked events not showing

Events sent via client.track() may not appear in the Harness FME UI even if the call succeeds. This usually happens because the FME Cloud silently rejects requests with invalid data.

Common causes include event type names containing invalid characters, such as spaces (e.g., client.track("userId", "client", "my conversion");), or specifying a traffic type that doesn’t exist in your Split organization (e.g., client.track("userId", "IncorrectTrafficType", "conversion");).

To resolve this, ensure event type names and traffic types follow the guidelines in the SDK Overview documentation, and verify that the traffic types you use are defined in your organization.