Skip to content

ParseFile seems to not handled in ParseObject _canbeSerialized function #242

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

Closed
gorillatapstudio opened this issue Aug 7, 2019 · 3 comments

Comments

@gorillatapstudio
Copy link

L221 of parse_object.dart

if (value is ParseObject) {
if (value.objectId == null && !aftersaving.contains(value)) {
return false;
}
}

when value is ParseFile, it does not have objectId, but it does not mean it is a new unsaved object, which is the intention of the null check here.
My object that contains ParseFile seems to have infinite saving loop here.
Am i using it correctly or is it a bug here?
Thanks!

@aBuder
Copy link

aBuder commented Aug 13, 2020

I also have the same issue:

    plan.set('name', name);
    plan.set('text', description);
    plan.set('startedAt', start);
    plan.set('endedAt', start.add(Duration(days: (7 * duration))));
    plan.set('minRepetition', minRepetition);
    plan.set('isTemplate', false);
    plan.set<ParseObject>('user', user);
    final response = await plan.save();
    if (template != null) {
      await _createPlanItems();
    }
0      _CompactIterator.moveNext  (dart:collection-patch/compact_hash.dart:451:3)
#1      ParseObject._canbeSerialized 
package:parse_server_sdk/…/objects/parse_object.dart:235
#2      ParseObject._canbeSerialized 
package:parse_server_sdk/…/objects/parse_object.dart:247
#3      ParseObject._canbeSerialized 
package:parse_server_sdk/…/objects/parse_object.dart:236
#4      ParseObject._canbeSerialized 
package:parse_server_sdk/…/objects/parse_object.dart:247
#5      ParseObject._canbeSerialized 
package:parse_server_sdk/…/objects/parse_object.dart:236
#6      ParseObject._canbeSerialized 
package:parse_server_sdk/…/objects/parse_object.dart:247
#7      ParseObject._canbeSerialized 
package:parse_server_sdk/…/objects/parse_object.dart:236
#8      ParseObject._canbeSerialized 
package:parse_server_sdk/…/objects/parse_object.dart:247
#9      ParseObject._canbeSerialized (package:parse_ser<…

@nstrelow
Copy link
Contributor

nstrelow commented Aug 19, 2020

I now also have this problem for some reason.

I seem to have had a null value in some nested field.
There should be a clear error for that and not a StackOverflow from endless recursion.

from parse_object.dart

bool _canbeSerialized(List<dynamic> aftersaving, {dynamic value}) {
if (value != null) {
...
} else if (!_canbeSerialized(aftersaving, value: _getObjectData())) {
      return false;
}

It seems like even what the object is null it tries to rerun the _canbeSerialized with _getObjectData(), which should return and empty map when the object is null. Not sure if this happens correctly.

@RodrigoSMarques
Copy link
Contributor

We are closing issues that have been open for a long time without activity.
This will make it easier to organize things from now on.
If the problem persists, please open a new issue.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants