Skip to content
17 changes: 17 additions & 0 deletions packages/dart/lib/parse_server_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ part 'src/network/options.dart';
part 'src/network/parse_client.dart';
part 'src/network/parse_connectivity.dart';
part 'src/network/parse_live_query.dart';
part 'src/network/parse_network_retry.dart';
part 'src/network/parse_query.dart';
part 'src/objects/parse_acl.dart';
part 'src/objects/parse_array.dart';
Expand Down Expand Up @@ -100,6 +101,18 @@ class Parse {
/// debug: true,
/// liveQuery: true);
/// ```
///
/// Parameters:
///
/// * [restRetryIntervals] - Optional list of retry delay intervals (in milliseconds)
/// for read operations. Applies to: GET, DELETE, and getBytes methods.
/// Defaults to [0, 250, 500, 1000, 2000].
/// * [restRetryIntervalsForWrites] - Optional list of retry delay intervals for
/// write operations. Applies to: POST, PUT, and postBytes methods.
/// Defaults to [] (no retries) to prevent duplicate data creation.
/// Configure only if you have idempotency guarantees in place.
/// * [liveListRetryIntervals] - Optional list of retry delay intervals for
/// LiveQuery operations.
Future<Parse> initialize(
String appId,
String serverUrl, {
Expand All @@ -118,6 +131,8 @@ class Parse {
Map<String, ParseObjectConstructor>? registeredSubClassMap,
ParseUserConstructor? parseUserConstructor,
ParseFileConstructor? parseFileConstructor,
List<int>? restRetryIntervals,
List<int>? restRetryIntervalsForWrites,
List<int>? liveListRetryIntervals,
ParseConnectivityProvider? connectivityProvider,
String? fileDirectory,
Expand All @@ -144,6 +159,8 @@ class Parse {
registeredSubClassMap: registeredSubClassMap,
parseUserConstructor: parseUserConstructor,
parseFileConstructor: parseFileConstructor,
restRetryIntervals: restRetryIntervals,
restRetryIntervalsForWrites: restRetryIntervalsForWrites,
liveListRetryIntervals: liveListRetryIntervals,
connectivityProvider: connectivityProvider,
fileDirectory: fileDirectory,
Expand Down
8 changes: 8 additions & 0 deletions packages/dart/lib/src/data/parse_core_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class ParseCoreData {
Map<String, ParseObjectConstructor>? registeredSubClassMap,
ParseUserConstructor? parseUserConstructor,
ParseFileConstructor? parseFileConstructor,
List<int>? restRetryIntervals,
List<int>? restRetryIntervalsForWrites,
List<int>? liveListRetryIntervals,
ParseConnectivityProvider? connectivityProvider,
String? fileDirectory,
Expand All @@ -52,6 +54,10 @@ class ParseCoreData {
_instance.sessionId = sessionId;
_instance.autoSendSessionId = autoSendSessionId;
_instance.securityContext = securityContext;
_instance.restRetryIntervals =
restRetryIntervals ?? <int>[0, 250, 500, 1000, 2000];
_instance.restRetryIntervalsForWrites =
restRetryIntervalsForWrites ?? <int>[];
_instance.liveListRetryIntervals =
liveListRetryIntervals ??
(parseIsWeb
Expand Down Expand Up @@ -89,6 +95,8 @@ class ParseCoreData {
late bool debug;
late CoreStore storage;
late ParseSubClassHandler _subClassHandler;
late List<int> restRetryIntervals;
late List<int> restRetryIntervalsForWrites;
late List<int> liveListRetryIntervals;
ParseConnectivityProvider? connectivityProvider;
String? fileDirectory;
Expand Down
Loading