Skip to content

Commit 9431086

Browse files
authored
feat: Add saveEventually and deleteEventually in ParseObject (#911)
1 parent 21ce56f commit 9431086

10 files changed

+423
-7
lines changed

packages/dart/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [6.2.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-6.1.0...dart-6.2.0) (2023-10-18)
2+
3+
### Features
4+
5+
* Added `saveEventually` and `deleteEventually` in `ParseObject` ([#911](https://github.com/parse-community/Parse-SDK-Flutter/pull/911))
6+
17
## [6.1.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-6.0.0...dart-6.1.0) (2023-10-17)
28

39
### Features

packages/dart/lib/parse_server_sdk.dart

+60
Original file line numberDiff line numberDiff line change
@@ -27,62 +27,116 @@ export 'src/network/parse_dio_client.dart';
2727
export 'src/network/parse_http_client.dart';
2828

2929
part 'src/base/parse_constants.dart';
30+
3031
part 'src/data/parse_core_data.dart';
32+
3133
part 'src/data/parse_subclass_handler.dart';
34+
3235
part 'src/enums/parse_enum_api_rq.dart';
36+
3337
part 'src/network/options.dart';
38+
3439
part 'src/network/parse_client.dart';
40+
3541
part 'src/network/parse_connectivity.dart';
42+
3643
part 'src/network/parse_live_query.dart';
44+
3745
part 'src/network/parse_query.dart';
46+
3847
part 'src/objects/parse_acl.dart';
48+
3949
part 'src/objects/parse_array.dart';
50+
4051
part 'src/objects/parse_base.dart';
52+
4153
part 'src/objects/parse_cloneable.dart';
54+
4255
part 'src/objects/parse_config.dart';
56+
4357
part 'src/objects/parse_error.dart';
58+
4459
part 'src/objects/parse_file.dart';
60+
4561
part 'src/objects/parse_number.dart';
62+
4663
part 'src/objects/parse_file_base.dart';
64+
4765
part 'src/objects/parse_file_web.dart';
66+
4867
part 'src/objects/parse_function.dart';
68+
4969
part 'src/objects/parse_geo_point.dart';
70+
5071
part 'src/objects/parse_installation.dart';
72+
5173
part 'src/objects/parse_object.dart';
74+
5275
part 'src/objects/parse_exception.dart';
76+
5377
part 'src/objects/parse_operation/parse_add_operation.dart';
78+
5479
part 'src/objects/parse_operation/parse_add_relation_operation.dart';
80+
5581
part 'src/objects/parse_operation/parse_add_unique_operation.dart';
82+
5683
part 'src/objects/parse_operation/parse_increment_operation.dart';
84+
5785
part 'src/objects/parse_operation/parse_operation.dart';
86+
5887
part 'src/objects/parse_operation/parse_remove_operation.dart';
88+
5989
part 'src/objects/parse_operation/parse_remove_relation_operation.dart';
90+
6091
part 'src/objects/parse_relation.dart';
92+
6193
part 'src/objects/parse_response.dart';
94+
6295
part 'src/objects/parse_save_state_aware_child.dart';
96+
6397
part 'src/objects/parse_session.dart';
98+
6499
part 'src/objects/parse_user.dart';
100+
65101
part 'src/objects/response/parse_error_response.dart';
102+
66103
part 'src/objects/response/parse_exception_response.dart';
104+
67105
part 'src/objects/response/parse_response_builder.dart';
106+
68107
part 'src/objects/response/parse_response_utils.dart';
108+
69109
part 'src/objects/response/parse_success_no_results.dart';
110+
70111
part 'src/storage/core_store.dart';
112+
71113
part 'src/storage/core_store_memory.dart';
114+
72115
part 'src/storage/core_store_sem_impl.dart';
116+
73117
part 'src/storage/xxtea_codec.dart';
118+
74119
part 'src/utils/parse_date_format.dart';
120+
75121
part 'src/utils/parse_decoder.dart';
122+
76123
part 'src/utils/parse_encoder.dart';
124+
77125
part 'src/utils/parse_live_list.dart';
126+
78127
part 'src/utils/parse_logger.dart';
128+
79129
part 'src/utils/parse_login_helpers.dart';
130+
80131
part 'src/utils/parse_utils.dart';
132+
81133
part 'src/utils/valuable.dart';
82134

83135
class Parse {
84136
bool _hasBeenInitialized = false;
85137

138+
static bool objectsExistForEventually = false;
139+
86140
/// To initialize Parse Server in your application
87141
///
88142
/// This should be initialized in MyApp() creation
@@ -148,6 +202,12 @@ class Parse {
148202

149203
_hasBeenInitialized = true;
150204

205+
objectsExistForEventually = await checkObjectsExistForEventually();
206+
207+
if (objectsExistForEventually) {
208+
ParseObject.submitEventually();
209+
}
210+
151211
return this;
152212
}
153213

packages/dart/lib/src/base/parse_constants.dart

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
part of flutter_parse_sdk;
22

33
// Library
4-
const String keySdkVersion = '6.1.0';
4+
const String keySdkVersion = '6.2.0';
55
const String keyLibraryName = 'Flutter Parse SDK';
66

77
// End Points
@@ -59,6 +59,8 @@ const String keyParamSessionToken = 'sessionToken';
5959
// Storage
6060
const String keyParseStoreBase = 'flutter_parse_sdk_';
6161
const String keyParseStoreUser = '${keyParseStoreBase}user';
62+
const String keyParseStoreObjects = '${keyParseStoreBase}objects';
63+
const String keyParseStoreDeletes = '${keyParseStoreBase}deletes';
6264
const String keyParseStoreInstallation = '${keyParseStoreBase}installation';
6365

6466
// Installation
@@ -82,5 +84,6 @@ const String keyVarInstallationId = 'installationId';
8284
// Error
8385
const String keyError = 'error';
8486
const String keyCode = 'code';
87+
const String keyNetworkError = 'NetworkError';
8588

8689
const bool parseIsWeb = identical(0, 0.0);

packages/dart/lib/src/network/parse_dio_client.dart

+2
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ class _ParseDioClient with dio.DioMixin implements dio.Dio {
229229
_logCUrl(options, data, path);
230230
}
231231

232+
checkForSubmitEventually();
233+
232234
return super.request(
233235
path,
234236
data: data,

packages/dart/lib/src/network/parse_http_client.dart

+2
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ class _ParseHTTPClient extends http.BaseClient {
158158
_logCUrl(request);
159159
}
160160

161+
checkForSubmitEventually();
162+
161163
return _client.send(request);
162164
}
163165

0 commit comments

Comments
 (0)