You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Again I don't have a minimal example for this problem but some references to the code. Sorry for that 馃槥.
We're having an issue with submitChanges() to submit an entity created with createEntry().
When the first request is successful, everything works fine. The Context is updated, mChangedEntities is updated, hasPendingChanges returns false afterwards.
The problems start to happen when the first request fails. The user may have entered an invalid value, the backend responds with a HTTP 400 and some error messages. The user fixes his error, clicks "save" again. A new submitChanges() is triggerd. It creates a new request that does NOT contain a reference to the context created by createEntry() (because that gets assigned by createEntry). That way, the - now successful - response does not update the context nor mChangedEntities and by this, hasPendingChanges() returns true although the POST-Request went well.
This happens with useBatch=true and useBatch=false, no difference.
Has someone already solved that problem? Are we doing something wrong?
Here is roughly what we are doing:
So we currently depend on hasPendingChanges() to check if the changed/created entity has unsaved changes. This works for updates & "perfect" creates but failes only for the case described above.
The text was updated successfully, but these errors were encountered:
Again I don't have a minimal example for this problem but some references to the code. Sorry for that 馃槥.
We're having an issue with submitChanges() to submit an entity created with createEntry().
When the first request is successful, everything works fine. The Context is updated, mChangedEntities is updated, hasPendingChanges returns false afterwards.
The problems start to happen when the first request fails. The user may have entered an invalid value, the backend responds with a HTTP 400 and some error messages. The user fixes his error, clicks "save" again. A new submitChanges() is triggerd. It creates a new request that does NOT contain a reference to the context created by createEntry() (because that gets assigned by createEntry). That way, the - now successful - response does not update the context nor mChangedEntities and by this, hasPendingChanges() returns true although the POST-Request went well.
This happens with useBatch=true and useBatch=false, no difference.
Has someone already solved that problem? Are we doing something wrong?
Here is roughly what we are doing:
So we currently depend on hasPendingChanges() to check if the changed/created entity has unsaved changes. This works for updates & "perfect" creates but failes only for the case described above.
The text was updated successfully, but these errors were encountered: