Function Error Unsupported Sequence Of Object Edits

it seems that function will throw error like
"Failed to apply edits
Error: [Actions] UnsupportedSequenceOfObjectEdits…"

underlying typescript codes which i had tried:

await this.deleteObjects(objectInstance);
await this.createObjects(objectInstance);

await this.deleteObjects(objectInstance).then(createObjects(objectInstance)…

*take note I was just trying to replace the old objects with new objects (may have overlapping similar composite primary key conditions)

Would anyone have any good idea how I should go about executing this in a single function. As of now, I am splitting both into 2 separate functions.

Hi there! Do you know how you determine the primary key for the new object? Since when the primary key of the old object to delete is the same as the new object to create, we are effectively performing a modification on the old object. Could we check for the condition when the primary key overlaps and perform a modification on the existing object instead?

Extra context

When perform multiple ontology edits in the same function, function will attempts to merge them into a single edit operation if possible. For certain combinations of edits, such as deleting and then creating objects that may have overlapping primary key, contains some ambiguity and as far as I know is currently not supported in the merging process.

thanks alot for confirming as i suspected the merge is not supported. Guess I will handle the merge logic in the codes