Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/src/flagsmith_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class FlagsmithClient {
}
} on DioException catch (e) {
log('_setupAnalyticsTimer dioError: ${e.error}');
throw FlagsmithApiException(e);
} catch (e) {
log('Exception: _setupAnalyticsTimer $e');
throw FlagsmithException(e);
Expand Down
7 changes: 3 additions & 4 deletions test/fg/flagsmith_analytics_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void main() {
expect(response?.statusCode, 200);
expect(fs.flagAnalytics.isEmpty, isTrue);
});
test('When analytics was sent and failed, then current store is not empty',
test('When analytics sync fails due to network error, it does not throw and preserves data',
() async {
setupEmptyAdapter(fs, cb: (config, adapter) {
adapter.onPost(fs.config.analyticsURI, (server) {
Expand All @@ -86,9 +86,8 @@ void main() {
await fs.getFeatureFlagValue('my_feature');
expect(fs.flagAnalytics.containsKey('my_feature'), isTrue);
expect(fs.flagAnalytics['my_feature'], 2);
expect(
() => fs.syncAnalyticsData(), throwsA(isA<FlagsmithApiException>()));

final response = await fs.syncAnalyticsData();
expect(response, isNull);
expect(fs.flagAnalytics.isEmpty, isFalse);
});
});
Expand Down