Skip to content

Commit b07ce8c

Browse files
authored
fix: ParseUser.save fails when user is logged in (#822)
1 parent 664689c commit b07ce8c

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

packages/dart/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [3.1.13](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.12...dart-3.1.13) (2023-02-15)
2+
3+
### Bug Fixes
4+
5+
* `ParseUser.save` fails when user is logged in ([#819](https://github.com/parse-community/Parse-SDK-Flutter/issues/819))
6+
17
## [3.1.12](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.11...dart-3.1.12) (2023-02-01)
28

39
### Bug Fixes

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

+1-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 = '3.1.12';
4+
const String keySdkVersion = '3.1.13';
55
const String keyLibraryName = 'Flutter Parse SDK';
66

77
// End Points

packages/dart/lib/src/objects/parse_base.dart

+11-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,15 @@ abstract class ParseBase {
117117
@override
118118
String toString() => json.encode(toJson());
119119

120+
dynamic fromJsonForManualObject(Map<String, dynamic> objectData) {
121+
return _fromJson(objectData, true);
122+
}
123+
120124
dynamic fromJson(Map<String, dynamic> objectData) {
125+
return _fromJson(objectData, false);
126+
}
127+
128+
dynamic _fromJson(Map<String, dynamic> objectData, bool addInUnSave) {
121129
objectData.forEach((String key, dynamic value) {
122130
if (key == parseClassName || key == '__type') {
123131
// NO OP
@@ -139,7 +147,9 @@ abstract class ParseBase {
139147
_getObjectData()[keyVarAcl] = ParseACL().fromJson(value);
140148
} else {
141149
_getObjectData()[key] = parseDecode(value);
142-
_unsavedChanges[key] = _getObjectData()[key];
150+
if (addInUnSave) {
151+
_unsavedChanges[key] = _getObjectData()[key];
152+
}
143153
}
144154
});
145155

packages/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: parse_server_sdk
22
description: Dart plugin for Parse Server, (https://parseplatform.org), (https://back4app.com)
3-
version: 3.1.12
3+
version: 3.1.13
44
homepage: https://github.com/parse-community/Parse-SDK-Flutter
55

66
environment:

0 commit comments

Comments
 (0)