I’m trying to understand what guarantees CSSearchableIndex batching provides.
beginBatch()
// submit changes to searchable items (add/update/delete)
endBatch(withClientState: newState)
Two questions:
1. Persistence before endBatch
If the app crashes after submitting changes to searchable items, but before calling endBatch, are those changes guaranteed not to be persisted?
If the answer is yes, then the follow-up question is:
2. Atomicity of endBatch
When endBatch(withClientState:) succeeds, is the batch atomic with respect to all submitted item changes, and the new client state?
In other words, is it guaranteed that:
- either all submitted item changes and the new client state are persisted,
- or neither is persisted?
Or is there any internal failure scenario in which the batch is only partially persisted – for example, some or all of the item changes persisted, but without the corresponding client state?