CloudKit JS: "recordChangeTag specified, but record not found"

I'm trying to update an existing record. I have a record I got back from a previous query. It has a valid recordName, and recordChangeTag. When I pass that record to either

Code Block
newRecordsBatch().update

or
Code Block
saveRecords


I get the error in the subject.

I ran across an old post from 4 years ago that said something about defining the ZoneID on the record, but I already have that defined from the query. It's using com.apple.coredata.cloudkit.zone.





Answering my own question! Turns out ZoneId is the answer, just not the way I thought. Had to pass in com.apple.coredata.cloudkit.zone to the options, like this:

Code Block
ZONE_ID = 'com.apple.coredata.cloudkit.zone';
const response = await this.cloudKitService.db.saveRecords([task],
{ zoneID: this.ZONE_ID });

And now it works!
CloudKit JS: "recordChangeTag specified, but record not found"
 
 
Q