parse-community / Parse-SDK-Flutter

The Dart/Flutter SDK for Parse Platform
https://parseplatform.org
Apache License 2.0
575 stars 186 forks source link

allowCustomObjectId does not work #938

Open catalunha opened 1 year ago

catalunha commented 1 year ago

New Issue Checklist

Issue Description

Before composing this issue I found this quote, but it didn't solve the problem. https://github.com/parse-community/Parse-SDK-Flutter/issues/567

In my back4app project I have the following configuration in Custom Parse Server Options

{
    "allowCustomObjectId": true
}

When importing new objects with id into a class via csv the use of the original id is normally accepted.

objectId,name
123abc,abc

But when I save the new object via SDK with the following commands:

final parseObject = ParseObject('Patient');
parseObject.objectId ='456def';
parseObject.set('name', 'def');
final response = await parseObject.save();

I get this error.

saving => 456def
 ----
ParseException (Type: ObjectNotFound) :
Code: 101
Message: Object not found.
----

However, for objects that have already been saved via csv, I don't get an error.

Steps to reproduce

Actual Outcome

Expected Outcome

That a new object be saved via SDK with id sent equal to import via csv

Environment

Parse Flutter SDK

Server

Logs

parse-github-assistant[bot] commented 1 year ago

Thanks for opening this issue!

longnguyen0410 commented 9 months ago

I have the same issue. It works when using object.create(allowCustomObjectId: true); But when I use object.save() it throws the exception: "Object not found"