Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

velicuvlad
Copy link
Contributor

  • Included Test 27 into Test 26: count(), valueAtIndex(), setVector(), skipVector() and finish() will throw an NSException if the updater is already finished.
  • Updated to LiteCore 3.2.0-211

use of updater after finish will throw exception
@velicuvlad velicuvlad changed the title CBL-5893: Throw exception for everything if finish() was called beforehand CBL-5893: Throw exception for everything if finish() was successfully called beforehand Jul 2, 2024
Copy link
Contributor

@bmeike bmeike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these documented tests now? There was a (somewhat silly) rule, at one point, that nobody was allowed to test anything that everybody didn't test. These tests are obviously useful, so they should be in the test spec, if they are not.

@velicuvlad
Copy link
Contributor Author

@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
Copy link
Contributor

bmeike commented Jul 3, 2024

Boy I hate these changes....

@pasin
Copy link
Contributor

pasin commented Jul 3, 2024

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.

@velicuvlad velicuvlad merged commit 3de150c into release/3.2 Jul 8, 2024
8 checks passed
@velicuvlad velicuvlad deleted the CBL-5893 branch July 8, 2024 16:03
pasin added a commit that referenced this pull request Jul 23, 2024
* CBL-5524 : Add all keys to the Privacy Manifest file (#3258)
* CBL-5541 : Update vector search test per changes in v1.8 (#3260)
* CBL-5365: Remove CBLErrors.h from Swift Public API (#3271)
* CBL-5508: Update Min macOS Support Version to 12.0 (#3272)
* CBL-5693 : Fix missing exported symbols (#3281)
* CBL-5222: MutableDocument should be usable before creating a database instance (#3278)
* CBL-5710: Add note that the replicator cannot be started in the inBatch() function (#3286)
* CBL-5514: Swift MutableDocument's collection is not set when a new document is saved (#3287)
* CBL-5660 : Fix a released query context may be used in observer callback (#3285)
* CBL-5668: Get Code Coverage at least 80% (#3289)
* CBL-3385: Allow null expression parameter for Function.count(expression) (#3290)
* CBL-5750  + CBL-5757  Lazy Index - ObjC (#3291)
* CBL-5811 : Support Vector Dimension to 4096 and Vector in Base64 String (#3294)
* CBL-5803 : Implement Lazy Vector Index and Test for Swift (#3295)
* CBL-5567 : Implement log replicator heiroglyphics (#3296)
* CBL-5859 : Allow explicitly enable vector search (#3297)
* CBL-5886: Add missing numProbes and correct min/maxTrainingSize default value (#3298)
* CBL-5932: Update default constants and public symbols (#3299)
* CBL-5928 : CBLErrors.h is not included in the umbrella header (#3301)
* CBL-5927 : Fix Duplicate CBLQueryIndex Interface Definition (#3300)
* CBL-5893: Throw exception for everything if finish() was successfully called beforehand (#3302)
* CBL-5956: Update DistanceMetric (#3303)
* CBL-5690 : Update Distance Metric Enum and VS SQL in Tests (#3304)
* CBL-5990 : Fix _kCBLDefaultLogFileUsePlaintext symbol (#3305)
velicuvlad added a commit that referenced this pull request Nov 11, 2024
* CBL-5524 : Add all keys to the Privacy Manifest file (#3258)
* CBL-5541 : Update vector search test per changes in v1.8 (#3260)
* CBL-5365: Remove CBLErrors.h from Swift Public API (#3271)
* CBL-5508: Update Min macOS Support Version to 12.0 (#3272)
* CBL-5693 : Fix missing exported symbols (#3281)
* CBL-5222: MutableDocument should be usable before creating a database instance (#3278)
* CBL-5613: Swift API docs for Scope using Obj-c reference (#3284)
* CBL-5710: Add note that the replicator cannot be started in the inBatch() function (#3286)
* CBL-5514: Swift MutableDocument's collection is not set when a new document is saved (#3287)
* CBL-5660 : Fix a released query context may be used in observer callback (#3285)
* CBL-5668: Get Code Coverage at least 80% (#3289)
* CBL-3385: Allow null expression parameter for Function.count(expression) (#3290)
* CBL-5750  + CBL-5757  Lazy Index - ObjC (#3291)
* CBL-5811 : Support Vector Dimension to 4096 and Vector in Base64 String (#3294)
* CBL-5803 : Implement Lazy Vector Index and Test for Swift (#3295)
* CBL-5567 : Implement log replicator heiroglyphics (#3296)
* CBL-5859 : Allow explicitly enable vector search (#3297)
* CBL-5886: Add missing numProbes and correct min/maxTrainingSize default value (#3298)
* CBL-5932: Update default constants and public symbols (#3299)
* CBL-5928 : CBLErrors.h is not included in the umbrella header (#3301)
* CBL-5927 : Fix Duplicate CBLQueryIndex Interface Definition (#3300)
* CBL-5893: Throw exception for everything if finish() was successfully called beforehand (#3302)
* CBL-5956: Update DistanceMetric (#3303)
* CBL-5690 : Update Distance Metric Enum and VS SQL in Tests (#3304)
* CBL-5990 : Fix _kCBLDefaultLogFileUsePlaintext symbol (#3305)
* CBL-6070: Implement Database Full-Sync Option (#3318)
* CBL-6144: Add testConcurrentCreateAndQuery to verify query's lock (#3320)
* CBL-6191 : Fix null URL for proxy CONNECT request (#3324)
* CBL-5180: Implement Array Index API (#3327)
* CBL-5181: Array Index API tests and adjustments (#3330)
* CBL-5899
* CBL-6307: Database MMap Configuration API and tests (#3333)
* CBL-6349: Implement Document's getRevisionHistory() for E2E Test Server (#3335)
* LiteCore 3.2.1-19
* Export symbol for mmap constant (#3341)
* ArrayIndexConfiguration explicit expressions arg on set (#3342)

---------

Co-authored-by: Pasin Suriyentrakorn <pasin@couchbase.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants