couchbase / couchbase-lite-ios

Lightweight, embedded, syncable NoSQL database engine for iOS and MacOS apps.
Apache License 2.0
1.62k stars 297 forks source link

CBL-5893: Throw exception for everything if finish() was successfully called beforehand #3302

Closed velicuvlad closed 2 months ago

velicuvlad commented 2 months ago
velicuvlad commented 2 months ago

@bmeike Spec was update last night so, in short yes. - Test 27. Also, as noted in test 27 description, itself and test 26 can be merged into a single on and this is what I've done in this PR. Now, it might be the case that I chose the wrong exception to throw, so I will be waiting for Pasin's review. IllegalStateArgumentException I can't find this exact exception, so I've used NSInternalInconsistencyException

bmeike commented 2 months ago

Boy I hate these changes....

pasin commented 2 months ago

We had have a long discussion in Slack last week about this. It was a conclusion that we will make it illegal to use the index updater after calling finish. Sorry, I didn't have time to update the test spec after the discussion. For iOS, it's correct to throw NSInternalInconsistencyException.