Description
Based on LiteCore (3dc6336cf452ecb985e49764dbe20016cbcf028d), c4doc_resolveConflict returns assertion failed instead of not-found error as before when resolving conflicts on a purge doc.
Log:
2021-02-24 18:50:27.877032-0800 xctest[15169:6608915] CouchbaseLite Database ERROR: Assertion failed: !_unknown (RevTree.cc:123, in currentRevision) 0 CouchbaseLite litecore::RevTree::currentRevision() + 170 |
1 CouchbaseLite c4Internal::TreeDocument::loadRevisions() + 291 |
2 CouchbaseLite c4Internal::TreeDocument::resolveConflict(FLSlice, FLSlice, FLSlice, unsigned char, bool) + 1423 |
3 CouchbaseLite c4doc_resolveConflict::$_12::operator()() const + 1008 |
4 CouchbaseLite c4doc_resolveConflict + 1197 |
5 CouchbaseLite -[CBLDatabase saveResolvedDocument:withLocalDoc:remoteDoc:error:] + 6711 |
6 CouchbaseLite -[CBLDatabase resolveConflictInDocument:withConflictResolver:error:] + 8066 |
7 CouchbaseLite -[CBLReplicator _resolveConflict:] + 1689 |
8 CouchbaseLite __33-[CBLReplicator resolveConflict:]_block_invoke + 224 |
9 libclang_rt.asan_osx_dynamic.dylib __wrap_dispatch_async_block_invoke + 203 |
10 libdispatch.dylib _dispatch_call_block_and_release + 12 |
11 libdispatch.dylib _dispatch_client_callout + 8 |
12 libdispatch.dylib _dispatch_continuation_pop + 423 |
13 libdispatch.dylib _dispatch_async_redirect_invoke + 713 |
14 libdispatch.dylib _dispatch_root_queue_drain + 326 |
15 libdispatch.dylib _dispatch_worker_thread2 + 92 |
16 libsystem_pthread.dylib _pthread_wqthread + 244 |
17 libsystem_pthread.dylib start_wqthread + 15 |
2021-02-24 18:50:27.877771-0800 xctest[15169:6608877] CouchbaseLite Replicator Debug: {Repl#31} terminate() called... |
2021-02-24 18:50:27.877967-0800 xctest[15169:6608877] CouchbaseLite Replicator Debug: {Repl#31} ...done with terminate() |
2021-02-24 18:50:27.878146-0800 xctest[15169:6608877] CouchbaseLite Replicator Info: {C4Replicator#34} State: stopped, progress=100.00% |
Reproduce:
- Get couchbase-lite-ios, checkout feature/vv-lite-core branch, and update submodules.
- Enable DatabaseTest+CustomConflict.m's _testConflictResolverWhenDocumentIsPurged by removing the underscore and run the test