fetchExperimentData method
Implementation
Future<FormattedExperimentApiResponse?> fetchExperimentData() async {
_fetchExperimentPromise =
_fetchExperimentDataFromAPI(_getUniqueId, _getUserId, _token);
try {
final result = await _fetchExperimentPromise;
if (result != null) {
_updateExperimentData(result);
}
} catch (error) {
Debug.print(
'[PI] Experiment Service: Error fetching experiment data - $error');
} finally {
_processTempEventQueue();
_fetchExperimentPromise = null;
}
return _fetchExperimentPromise;
}