Skip to content

Cherry picks from 4.1 to 3.4#500

Merged
borrrden merged 4 commits into
release/3.4from
4.1-3.4_cherry_picks
Jun 19, 2026
Merged

Cherry picks from 4.1 to 3.4#500
borrrden merged 4 commits into
release/3.4from
4.1-3.4_cherry_picks

Conversation

@borrrden

Copy link
Copy Markdown
Member

All commits came in as-is without conflict

pasin and others added 4 commits June 19, 2026 16:00
Make currentThread an AtomicLong so isInsideExecutor() reads a consistent, visible value across pool threads. Clear it with compareAndSet in the finally block so a task that has already claimed the thread for the next run is not cleared.
* Implemented Kotlin Serialization for Fleece

* Implemented serialization-based API extensions
- Collection.getDocumentAs(), save()
- Result.data()
- ResultSet.data()

* Implemented Collection.delete(DocumentModel)

* Allow null docID when saving new DocumentModel

* Fixes from code review (not all fixed)
- serializeToFleece() now returns a FLSliceResult not a ByteArray.
- Callers of the above use `use` to release the memory when done.
- Use `use` to release Fleece iterators.
- Collection.save(DocumentModel) interprets a null conflict handler as last-write-wins. This fixes a NPE bug too.

* FLValue.asString() should be marked @nullable per Jim.
Fixed FleeceDeserialization to handle null by returning "" instead.

* Ensure MutableDocument.setContentFromModel doesn't lose backing store

Co-authored-by: Jens Alfke <jens@couchbase.com>
…PI changes

* Replace var with explicit FLDict type in Document.setContent (common is compiled at Java 8)
* Suppress PMD SingularField and SpotBugs URF_UNREAD_FIELD on Document.extraBackingStore (keep-alive field)
* Add null check on FLValue.fromData() result in Document.setContent (NP_NULL_ON_SOME_PATH)
* Move serialization tests from test/java to test/kotlin so that only the android-ktx test builds compile them :
    - FleeceSerializationTest.kt moved as-is
    - ResultTest.kt renamed to ResultSerializationTest.kt
    - Serialization test and TestModel extracted from CollectionTest.kt into new CollectionSerializationTest.kt
btAttached() (incoming) now calls c4socket_retain, matching btOpen(), to balance the c4socket_release in NativeC4Socket_closed. Without it the incoming socket was double-freed on teardown (SIGABRT, invalid refCount -6666666).
@borrrden borrrden requested a review from pasin June 19, 2026 07:02
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

This is a release branch and commits are restricted.

Please confirm this PR is one of the following:

  • A response to a customer ask
  • A change per our security policy
  • A non-functional change (i.e. changes needed for building an older version)
  • A change that has been granted an exception (please comment)

@borrrden

Copy link
Copy Markdown
Member Author

3.4 / 4.1 parity

@pasin pasin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we also need 63ad929?

@borrrden

Copy link
Copy Markdown
Member Author

Do we also need 63ad929?

This commit came in as part of f490c0b

@borrrden borrrden merged commit b8409cd into release/3.4 Jun 19, 2026
1 check passed
@borrrden borrrden deleted the 4.1-3.4_cherry_picks branch June 19, 2026 23:19
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.

2 participants