Skip to content

Commit 456484a

Browse files
Merge pull request #548 from RodrigoSMarques/development
Fix CoreStoreSembastImp / Fix ParseACL / New Query Method / Updated Dependencies version / Fix error message parse_live_query.dart / Updated dependencies / Make ParseHTTPClient default Client
2 parents da674d2 + b6d5062 commit 456484a

18 files changed

+81
-38
lines changed

packages/dart/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 2.1.0
2+
Option para uses ParseHTTPClient (default) or ParseDioClient (slow on Flutter Web).
3+
**BREAKING CHANGE** if use progress callback at the file upload in version 2.0.1
4+
Added method excludeKeys: Exclude specific fields from the returned query
5+
Changed to the method POST on Login
6+
Bug fixes
7+
General improvements
8+
Updated dependencies
9+
110
## 2.0.1
211
Fixed network exceptions. [#482](https://github.com/parse-community/Parse-SDK-Flutter/pull/482)
312

packages/dart/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This is a work in progress and we are consistently updating it. Please let us kn
2020
To install, either add to your pubspec.yaml
2121
```yml
2222
dependencies:
23-
parse_server_sdk: ^2.0.1
23+
parse_server_sdk: ^2.1.0
2424
```
2525
or clone this repository and add to your project. As this is an early development with multiple contributors, it is probably best to download/clone and keep updating as an when a new feature is added.
2626

packages/dart/lib/parse_server_sdk.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'dart:typed_data';
88

99
import 'package:meta/meta.dart';
1010
import 'package:mime_type/mime_type.dart';
11-
import 'package:parse_server_sdk/src/network/parse_dio_client.dart';
11+
import 'package:parse_server_sdk/src/network/parse_http_client.dart';
1212
import 'package:parse_server_sdk/src/network/parse_websocket.dart'
1313
as parse_web_socket;
1414
import 'package:path/path.dart' as path;
@@ -94,7 +94,7 @@ class Parse {
9494
String clientKey,
9595
String masterKey,
9696
String sessionId,
97-
bool autoSendSessionId,
97+
bool autoSendSessionId = true,
9898
SecurityContext securityContext,
9999
CoreStore coreStore,
100100
Map<String, ParseObjectConstructor> registeredSubClassMap,

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

Lines changed: 1 addition & 1 deletion
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 = '2.0.1';
4+
const String keySdkVersion = '2.1.0';
55
const String keyLibraryName = 'Flutter Parse SDK';
66

77
// End Points

packages/dart/lib/src/data/parse_core_data.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class ParseCoreData {
125125
String fileDirectory;
126126
Stream<void> appResumedStream;
127127
ParseClientCreator clientCreator =
128-
({bool sendSessionId, SecurityContext securityContext}) => ParseDioClient(
128+
({bool sendSessionId, SecurityContext securityContext}) => ParseHTTPClient(
129129
sendSessionId: sendSessionId, securityContext: securityContext);
130130

131131
void registerSubClass(

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ class ParseDioClient extends ParseClient {
9898
final dio.Response<String> dioResponse = await _client.post<String>(
9999
path,
100100
data: data,
101-
options: _Options(
102-
headers: options?.headers, responseType: dio.ResponseType.bytes),
101+
options: _Options(headers: options?.headers),
103102
onSendProgress: onSendProgress,
104103
);
105104
return ParseNetworkResponse(

packages/dart/lib/src/network/parse_live_query.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class LiveQueryReconnectingController {
4646
connectivityProvider.connectivityStream.listen(_connectivityChanged);
4747
} else {
4848
print(
49-
'LiveQuery does not work, if there is ParseConnectivityProvider provided.');
49+
'LiveQuery does not work, if there is no ParseConnectivityProvider provided.');
5050
}
5151
_eventStream.listen((LiveQueryClientEvent event) {
5252
switch (event) {

packages/dart/lib/src/network/parse_query.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ class QueryBuilder<T extends ParseObject> {
8686
limiters['keys'] = concatenateArray(keys);
8787
}
8888

89+
///Exclude specific fields from the returned query
90+
///
91+
/// [String] keys not will return the columns of a result you want the data for
92+
void excludeKeys(List<String> keys) {
93+
limiters['excludeKeys'] = concatenateArray(keys);
94+
}
95+
8996
/// Includes other ParseObjects stored as a Pointer
9097
void includeObject(List<String> objectTypes) {
9198
limiters['include'] = concatenateArray(objectTypes);

packages/dart/lib/src/objects/parse_acl.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ParseACL {
5151
}
5252

5353
///Set whether the given user id is allowed to read this object.
54-
void setReadAccess({@required String userId, bool allowed}) {
54+
void setReadAccess({@required String userId, bool allowed = true}) {
5555
if (userId == null) {
5656
throw 'cannot setReadAccess for null userId';
5757
}
@@ -74,7 +74,7 @@ class ParseACL {
7474
}
7575

7676
///Set whether the given user id is allowed to write this object.
77-
void setWriteAccess({@required String userId, bool allowed}) {
77+
void setWriteAccess({@required String userId, bool allowed = true}) {
7878
if (userId == null) {
7979
throw 'cannot setWriteAccess for null userId';
8080
}

packages/dart/lib/src/objects/parse_installation.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ class ParseInstallation extends ParseObject {
104104
final ParseResponse parseResponse =
105105
await _create(allowCustomObjectId: allowCustomObjectId);
106106
if (parseResponse.success && isCurrent) {
107+
clearUnsavedChanges();
107108
await saveInStorage(keyParseStoreInstallation);
108109
}
109110
return parseResponse;
@@ -119,6 +120,7 @@ class ParseInstallation extends ParseObject {
119120
//ParseResponse parseResponse = await super.save();
120121
final ParseResponse parseResponse = await _save();
121122
if (parseResponse.success && isCurrent) {
123+
clearUnsavedChanges();
122124
await saveInStorage(keyParseStoreInstallation);
123125
}
124126
return parseResponse;

0 commit comments

Comments
 (0)