Skip to content

Commit 9bc0d35

Browse files
committed
Update dependencies because of conflicts with uuid recent versions
1 parent ec71870 commit 9bc0d35

File tree

3 files changed

+39
-87
lines changed

3 files changed

+39
-87
lines changed

Diff for: packages/dart/lib/src/network/parse_live_query.dart

+26-74
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@ class Subscription<T extends ParseObject> {
1313
T? _copyObject;
1414
int requestId;
1515
bool _enabled = false;
16-
final List<String> _liveQueryEvent = <String>[
17-
'create',
18-
'enter',
19-
'update',
20-
'leave',
21-
'delete',
22-
'error'
23-
];
16+
final List<String> _liveQueryEvent = <String>['create', 'enter', 'update', 'leave', 'delete', 'error'];
2417
Map<String, Function> eventCallbacks = <String, Function>{};
2518

2619
void on(LiveQueryEvent op, Function callback) {
@@ -40,14 +33,12 @@ class LiveQueryReconnectingController {
4033
this._eventStream,
4134
this.debug,
4235
) {
43-
final ParseConnectivityProvider? connectivityProvider =
44-
ParseCoreData().connectivityProvider;
36+
final ParseConnectivityProvider? connectivityProvider = ParseCoreData().connectivityProvider;
4537
if (connectivityProvider != null) {
4638
connectivityProvider.checkConnectivity().then(_connectivityChanged);
4739
connectivityProvider.connectivityStream.listen(_connectivityChanged);
4840
} else {
49-
print(
50-
'LiveQuery does not work, if there is no ParseConnectivityProvider provided.');
41+
print('LiveQuery does not work, if there is no ParseConnectivityProvider provided.');
5142
}
5243
_eventStream.listen((LiveQueryClientEvent event) {
5344
switch (event) {
@@ -106,13 +97,8 @@ class LiveQueryReconnectingController {
10697
}
10798

10899
void _setReconnect() {
109-
if (_isOnline &&
110-
!_isConnected &&
111-
_currentTimer == null &&
112-
!_userDisconnected &&
113-
retryInterval[_retryState] >= 0) {
114-
_currentTimer =
115-
Timer(Duration(milliseconds: retryInterval[_retryState]), () {
100+
if (_isOnline && !_isConnected && _currentTimer == null && !_userDisconnected && retryInterval[_retryState] >= 0) {
101+
_currentTimer = Timer(Duration(milliseconds: retryInterval[_retryState]), () {
116102
_currentTimer = null;
117103
_reconnect();
118104
});
@@ -129,17 +115,14 @@ class LiveQueryReconnectingController {
129115
class LiveQueryClient {
130116
factory LiveQueryClient() => _getInstance();
131117

132-
LiveQueryClient._internal(this._liveQueryURL,
133-
{bool? debug, bool? autoSendSessionId}) {
118+
LiveQueryClient._internal(this._liveQueryURL, {bool? debug, bool? autoSendSessionId}) {
134119
_clientEventStreamController = StreamController<LiveQueryClientEvent>();
135-
_clientEventStream =
136-
_clientEventStreamController.stream.asBroadcastStream();
120+
_clientEventStream = _clientEventStreamController.stream.asBroadcastStream();
137121

138122
_debug = isDebugEnabled(objectLevelDebug: debug);
139123
_sendSessionId = autoSendSessionId ?? ParseCoreData().autoSendSessionId;
140124

141-
reconnectingController = LiveQueryReconnectingController(
142-
() => reconnect(userInitialized: false), getClientEventStream, _debug);
125+
reconnectingController = LiveQueryReconnectingController(() => reconnect(userInitialized: false), getClientEventStream, _debug);
143126
}
144127

145128
static LiveQueryClient get instance => _getInstance();
@@ -148,8 +131,7 @@ class LiveQueryClient {
148131
static LiveQueryClient _getInstance({bool? debug, bool? autoSendSessionId}) {
149132
String? liveQueryURL = ParseCoreData().liveQueryURL;
150133
if (liveQueryURL == null) {
151-
assert(false,
152-
'liveQueryUrl is not set. For how to setup Live Queries, see https://github.com/parse-community/Parse-SDK-Flutter/tree/master/packages/flutter#live-queries.');
134+
assert(false, 'liveQueryUrl is not set. For how to setup Live Queries, see https://github.com/parse-community/Parse-SDK-Flutter/tree/master/packages/flutter#live-queries.');
153135
liveQueryURL = "";
154136
} else {
155137
if (liveQueryURL.contains('https')) {
@@ -158,9 +140,7 @@ class LiveQueryClient {
158140
liveQueryURL = liveQueryURL.replaceAll('http', 'ws');
159141
}
160142
}
161-
LiveQueryClient instance = _instance ??
162-
LiveQueryClient._internal(liveQueryURL,
163-
debug: debug, autoSendSessionId: autoSendSessionId);
143+
LiveQueryClient instance = _instance ?? LiveQueryClient._internal(liveQueryURL, debug: debug, autoSendSessionId: autoSendSessionId);
164144
_instance ??= instance;
165145
return instance;
166146
}
@@ -197,8 +177,7 @@ class LiveQueryClient {
197177

198178
Future<dynamic> disconnect({bool userInitialized = false}) async {
199179
parse_web_socket.WebSocket? webSocket = _webSocket;
200-
if (webSocket != null &&
201-
webSocket.readyState == parse_web_socket.WebSocket.open) {
180+
if (webSocket != null && webSocket.readyState == parse_web_socket.WebSocket.open) {
202181
if (_debug) {
203182
print('$_printConstLiveQuery: Socket closed');
204183
}
@@ -218,21 +197,16 @@ class LiveQueryClient {
218197
});
219198
_connecting = false;
220199
if (userInitialized) {
221-
_clientEventStreamController.sink
222-
.add(LiveQueryClientEvent.userDisconnected);
200+
_clientEventStreamController.sink.add(LiveQueryClientEvent.userDisconnected);
223201
}
224202
}
225203

226-
Future<Subscription<T>> subscribe<T extends ParseObject>(
227-
QueryBuilder<T> query,
228-
{T? copyObject}) async {
204+
Future<Subscription<T>> subscribe<T extends ParseObject>(QueryBuilder<T> query, {T? copyObject}) async {
229205
if (_webSocket == null) {
230-
await _clientEventStream.any((LiveQueryClientEvent event) =>
231-
event == LiveQueryClientEvent.connected);
206+
await _clientEventStream.any((LiveQueryClientEvent event) => event == LiveQueryClientEvent.connected);
232207
}
233208
final int requestId = _requestIdGenerator();
234-
final Subscription<T> subscription =
235-
Subscription<T>(query, requestId, copyObject: copyObject);
209+
final Subscription<T> subscription = Subscription<T>(query, requestId, copyObject: copyObject);
236210
_requestSubscription[requestId] = subscription;
237211
//After a client connects to the LiveQuery server,
238212
//it can send a subscribe message to subscribe a ParseQuery.
@@ -272,8 +246,7 @@ class LiveQueryClient {
272246
_connecting = true;
273247

274248
try {
275-
parse_web_socket.WebSocket webSocket =
276-
await parse_web_socket.WebSocket.connect(_liveQueryURL);
249+
parse_web_socket.WebSocket webSocket = await parse_web_socket.WebSocket.connect(_liveQueryURL);
277250
_webSocket = webSocket;
278251
_connecting = false;
279252
if (webSocket.readyState == parse_web_socket.WebSocket.open) {
@@ -293,23 +266,16 @@ class LiveQueryClient {
293266

294267
chanelStream?.sink.add(message);
295268
}, onDone: () {
296-
_clientEventStreamController.sink
297-
.add(LiveQueryClientEvent.disconnected);
269+
_clientEventStreamController.sink.add(LiveQueryClientEvent.disconnected);
298270
if (_debug) {
299271
print('$_printConstLiveQuery: Done');
300272
}
301273
}, onError: (Object error) {
302-
_clientEventStreamController.sink
303-
.add(LiveQueryClientEvent.disconnected);
274+
_clientEventStreamController.sink.add(LiveQueryClientEvent.disconnected);
304275
if (_debug) {
305-
print(
306-
'$_printConstLiveQuery: Error: ${error.runtimeType.toString()}');
276+
print('$_printConstLiveQuery: Error: ${error.runtimeType.toString()}');
307277
}
308-
return Future<ParseResponse>.value(handleException(
309-
Exception(error),
310-
ParseApiRQ.liveQuery,
311-
_debug,
312-
!parseIsWeb ? 'IOWebSocketChannel' : 'HtmlWebSocketChannel'));
278+
return Future<ParseResponse>.value(handleException(Exception(error), ParseApiRQ.liveQuery, _debug, !parseIsWeb ? 'IOWebSocketChannel' : 'HtmlWebSocketChannel'));
313279
});
314280
} on Exception catch (e) {
315281
_connecting = false;
@@ -328,10 +294,7 @@ class LiveQueryClient {
328294
}
329295
//The connect message is sent from a client to the LiveQuery server.
330296
//It should be the first message sent from a client after the WebSocket connection is established.
331-
final Map<String, String> connectMessage = <String, String>{
332-
'op': 'connect',
333-
'applicationId': ParseCoreData().applicationId
334-
};
297+
final Map<String, String> connectMessage = <String, String>{'op': 'connect', 'applicationId': ParseCoreData().applicationId};
335298

336299
if (_sendSessionId) {
337300
String? sessionId = ParseCoreData().sessionId;
@@ -350,8 +313,7 @@ class LiveQueryClient {
350313
connectMessage['masterKey'] = masterKey;
351314
}
352315

353-
String? parseInstallation =
354-
(await ParseInstallation.currentInstallation()).installationId;
316+
String? parseInstallation = (await ParseInstallation.currentInstallation()).installationId;
355317
if (parseInstallation != null) {
356318
connectMessage['installationId'] = parseInstallation;
357319
}
@@ -381,12 +343,7 @@ class LiveQueryClient {
381343
final Map<String, dynamic> subscribeMessage = <String, dynamic>{
382344
'op': 'subscribe',
383345
'requestId': subscription.requestId,
384-
'query': <String, dynamic>{
385-
'className': query.object.parseClassName,
386-
'where': whereMap,
387-
if (keysToReturn != null && keysToReturn.isNotEmpty)
388-
'fields': keysToReturn
389-
}
346+
'query': <String, dynamic>{'className': query.object.parseClassName, 'where': whereMap, if (keysToReturn != null && keysToReturn.isNotEmpty) 'fields': keysToReturn}
390347
};
391348
if (_sendSessionId && ParseCoreData().sessionId != null) {
392349
subscribeMessage['sessionToken'] = ParseCoreData().sessionId;
@@ -430,13 +387,9 @@ class LiveQueryClient {
430387
final String? className = map['className'];
431388
if (className != null) {
432389
if (className == keyClassUser) {
433-
eventCallback((subscription.copyObject ??
434-
ParseCoreData.instance.createParseUser(null, null, null))
435-
.fromJson(map));
390+
eventCallback((subscription.copyObject ?? ParseCoreData.instance.createParseUser(null, null, null)).fromJson(map));
436391
} else {
437-
eventCallback((subscription.copyObject ??
438-
ParseCoreData.instance.createObject(className))
439-
.fromJson(map));
392+
eventCallback((subscription.copyObject ?? ParseCoreData.instance.createObject(className)).fromJson(map));
440393
}
441394
}
442395
} else {
@@ -451,8 +404,7 @@ class LiveQuery {
451404
LiveQuery({bool? debug, bool? autoSendSessionId}) {
452405
_debug = isDebugEnabled(objectLevelDebug: debug);
453406
_sendSessionId = autoSendSessionId ?? ParseCoreData().autoSendSessionId;
454-
client = LiveQueryClient._getInstance(
455-
debug: _debug, autoSendSessionId: _sendSessionId);
407+
client = LiveQueryClient._getInstance(debug: _debug, autoSendSessionId: _sendSessionId);
456408
}
457409

458410
bool? _debug;

Diff for: packages/dart/pubspec.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,25 @@ dependencies:
2424
# Networking
2525
dio: ^5.7.0
2626
http: ^1.2.0
27-
web_socket_channel: ^2.4.3
27+
web_socket_channel: ^3.0.2
2828

2929
#Database
30-
sembast: ^3.6.0
30+
sembast: ^3.8.2
3131
sembast_web: ^2.2.0
3232

3333
# Utils
3434
uuid: ^4.5.1
3535
meta: ^1.16.0
3636
path: ^1.9.0
37-
mime: ^1.0.0
38-
timezone: ^0.9.4
37+
mime: ^2.0.0
38+
timezone: ^0.10.0
3939
universal_io: ^2.2.2
4040
xxtea: ^2.1.0
4141
collection: ^1.18.0
4242
cross_file: ^0.3.3+8
4343

4444
dev_dependencies:
45-
lints: ^4.0.0
45+
lints: ^5.1.1
4646

4747
# Testing
4848
build_runner: ^2.4.9

Diff for: packages/flutter/pubspec.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,29 @@ dependencies:
2525
flutter:
2626
sdk: flutter
2727

28-
parse_server_sdk: ^6.4.0
29-
# Uncomment for local testing
30-
#parse_server_sdk:
31-
# path: ../dart
28+
# parse_server_sdk: ^8.0.0
29+
# Uncomment for local testing
30+
parse_server_sdk:
31+
path: ../dart
3232

3333
# Networking
3434
connectivity_plus: ^6.0.3
3535

3636
#Database
37-
shared_preferences: ^2.2.3
38-
sembast: ^3.6.0
37+
shared_preferences: ^2.5.2
38+
sembast: ^3.8.2
3939
sembast_web: ^2.2.0
4040

4141
# Utils
4242
path_provider: ^2.1.4
43-
package_info_plus: ^5.0.1
43+
package_info_plus: ^8.3.0
4444
path: ^1.8.3
4545

4646
dev_dependencies:
4747
flutter_test:
4848
sdk: flutter
4949

50-
flutter_lints: ^4.0.0
50+
flutter_lints: ^5.0.0
5151
path_provider_platform_interface: ^2.1.2
5252
plugin_platform_interface: ^2.1.8
5353

0 commit comments

Comments
 (0)