Skip to content

fix: ParseUser.save fails when user is logged in #822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/dart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [3.1.13](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.12...dart-3.1.13) (2023-02-15)

### Bug Fixes

* `ParseUser.save` fails when user is logged in ([#819](https://github.com/parse-community/Parse-SDK-Flutter/issues/819))

## [3.1.12](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.11...dart-3.1.12) (2023-02-01)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion packages/dart/lib/src/base/parse_constants.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
part of flutter_parse_sdk;

// Library
const String keySdkVersion = '3.1.12';
const String keySdkVersion = '3.1.13';
const String keyLibraryName = 'Flutter Parse SDK';

// End Points
Expand Down
12 changes: 11 additions & 1 deletion packages/dart/lib/src/objects/parse_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,15 @@ abstract class ParseBase {
@override
String toString() => json.encode(toJson());

dynamic fromJsonForManualObject(Map<String, dynamic> objectData) {
return _fromJson(objectData, true);
}

dynamic fromJson(Map<String, dynamic> objectData) {
return _fromJson(objectData, false);
}

dynamic _fromJson(Map<String, dynamic> objectData, bool addInUnSave) {
objectData.forEach((String key, dynamic value) {
if (key == parseClassName || key == '__type') {
// NO OP
Expand All @@ -139,7 +147,9 @@ abstract class ParseBase {
_getObjectData()[keyVarAcl] = ParseACL().fromJson(value);
} else {
_getObjectData()[key] = parseDecode(value);
_unsavedChanges[key] = _getObjectData()[key];
if (addInUnSave) {
_unsavedChanges[key] = _getObjectData()[key];
}
}
});

Expand Down
2 changes: 1 addition & 1 deletion packages/dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: parse_server_sdk
description: Dart plugin for Parse Server, (https://parseplatform.org), (https://back4app.com)
version: 3.1.12
version: 3.1.13
homepage: https://github.com/parse-community/Parse-SDK-Flutter

environment:
Expand Down