---
title: Kotlin
slug: release-notes/kotlin
icon: {"faIcon":"fa-brands fa-korvue"}
docTags: 
createdAt: 2024-03-07T16:12:44.827Z
---

![](https://api.archbee.com/api/optimize/qoRkNxW5fJ81r_NqVpc8C/TaLAOysyYxhbjYHTDmd1M_kotlin-ditto-icon-card-light-mode.png)

# 4.9.2 Version Release

*Release Date: Dec 19, 2024*

## 4.9.2 Kotlin Specific Changes

🛠️ **Fixed:** Race condition causing NullPointerException trying to initialize Ditto.

# 4.9.1 Version Release

*Release Date: Dec 13, 2024*

:::hint{type="danger"}
Known `NullPointerException` bug introduced in `4.9.0` please use `4.9.2` or later.
:::

## 4.9.1 Kotlin/Java Specific Changes

🛠️ **Fixed:** Crash in Android WiFi Aware due to too many requests (#15288)

🛠️ **Fixed:** avoid duplicated multicast connection on WiFi Aware (#15337)

🛠️ **Fixed:** WiFi Aware does not restart after a stopSync/startSync cycle (#15349)

🛠️ **Fixed:** Exceptions thrown from user-provided `registerObserver` lambdas are now logged as an error and re-thrown instead of triggering an unreadable rust panic. Use `Thread.setDefaultUncaughtExceptionHandler` to handle these exceptions.&#x20;

## 4.9.1 Common Changes

🛠️ **Fixed:** iOS 18 crashes related to Bluetooth LE are now resolved. (#15351)

🛠️ **Fixed:&#x20;**&#x44;isk usage stats are now reported in small peer info on android devices

# 4.9.0 Version Release

*Release Date: Nov 21, 2024*

:::hint{type="danger"}
Known `NullPointerException` bug introduced in `4.9.0` please use `4.9.2` or later.
:::

## 4.9.0 Kotlin/Java Specific Changes

➕ **Added:&#x20;**&#x52;eplacement suggestions to a few deprecated `DittoError` subclasses, making it easier to update error handling code. (#13162)

➕ **Added:&#x20;**&#x70;arameters to control WiFi Aware staleness detection (#13438)

➕ **Added:&#x20;**&#x49;NFO log for application background/foreground events (#13493)

➕ **Added:&#x20;**&#x45;rror log & transport condition updates in case of insufficient BLE capabilities (#13793)

➕ **Added:&#x20;**`transports_wifi_aware_background_mode` system parameter to control WiFi Aware terminating on background behaviour (#13970)

➕ **Added:** API docs for `DittoSmallPeerInfo` class. (#14202)

➕ **Added:&#x20;**&#x4E;ew `Ditto.updateTransportConfig()` method which takes a lambda expression for modifying the active `DittoTransportConfig`. (#7377)



🛠️ **Fixed:&#x20;**&#x70;roperly handle all foreground events (#14118)

🛠️ **Fixed:&#x20;**&#x41;ny exceptions thrown by a custom log callback will be logged as an error instead of crashing. (#14229)

🛠️ **Fixed:** internal presence observing is now only active when at least one `DittoPresenceObserver` is active, improving performance. (#14256)



⚠️ **Deprecated:&#x20;**`DittoBluetoothLeConfig.maxOutgoing`. This value can now be configured using the `mesh_chooser_max_active_ble_clients` system parameter. See docs for details: [https://docs.ditto.live/using-alter-system](https://docs.ditto.live/using-alter-system). (#12320)

⚠️ **Deprecated:&#x20;**`DittoLogger.ffiCustomLog()`. Use `DittoLog.i()` and friends to write to the Ditto log. (#12617)



❗️🗑️ **Removed (Experimental):** Experimental Bus API pending a newer stable API. (#13777)

❗️🗑️ **Removed:&#x20;**`dittoHandle` property, `delete()`, `swigReleaseOwnership()` and `swigTakeOwnership()` methods from `Presence`. These are internal memory management APIs that can cause memory leaks or crashes if used. (#14201)

## 4.9.0 Logging Clarity Improvements

This release comes with a number of logging clarity improvements. The goal of these changes are to make Ditto logs more consumable and actionable for end users. While there are wide ranging changes one of the principal goals of this work is to make our INFO level logs contain the right information to understand the state and health of the Ditto SDK.

- More information is included when physical connections start and end (such as the type of connection and the remote peer’s key)
- Devices that try to connect to themselves now say “device has connected to itself” instead of an error about the remote site ID being the same as the local peer
- Authentication client logs have been made more human readable. In particular:
  - Recoverable errors are logged together with information about the recovery actions that are being undertaken
  - Several abbreviations have been replaced with human-readable descriptions
  - Errors are printed using their descriptions rather than by dumping debug representations
- Abbreviated jargon has been replaced with clearer wording in various log lines
  - “phy ended” has become “physical connection ended”
  - “error getting char” has become “required Ditto BLE characteristic not found”
  - “error getting radio state” has become “error getting Windows Bluetooth radio state”
  - Peer events that represent a transport starting or stopping are now logged with the message “transport started”/”transport ended” rather than as a raw `peer_event=...` log
- Reduced the noisiness of “starting” log lines around Ditto initialization time
- Noise from long peer keys in logs has been reduced in some places by replacing them with their truncated form
- Noise from duplicated peer ID/peer key information in replication logs has been reduced by consolidating the information
- “starting compression and export” is now followed by a “completed export” log at the same level
- Successful SQLite WAL recovery logs were further lowered from `INFO` to `DEBUG`


4.9.0 Common Changes
--------------------

➕ **Added:** `regexp_like` function in DQL. (#12129)

➕ **Added:** peer\_metadata and identity\_service\_metadata to the small peer info document (#12477)

➕ **Added:&#x20;**&#x57;ebSocket connections now send `X-DITTO-PEERPUBKEY` and `X-DITTO-ROUTING-HINT` headers as part of the client connect handshake on all platforms except `wasm32` (#13171)

➕ **Added:&#x20;**&#x53;mall Peer Info now includes information about the current logger configuration (#14317)

➕ **Added:&#x20;**&#x50;ermission rules can be written in DQL. (#14563)

➕ **Added:&#x20;**&#x44;itto logs clearly indicate if a device has established a connection to itself. (#14634)

➕ **Added:&#x20;**&#x74;he ability for DQL select statement to produce arbitrary projection lists. (#7979)

➕ **Added:** local subscription info to small peer info (#9412)

➕ **Added:** "device\_disk\_usage" information to small peer info (#9784)

➕ **Added:** "store" information to small peer info (#9785)



⭐️❗️🔄 **Changed:** Internal sync metadata format changed. Peers that downgrade to a previous SDK version after upgrading may require full resynchronization. (#14799)

🔄 **Changed:** Improved (de)serialization performance and reduced its contribution to the library size (#11545)

🔄 **Changed:** In updated replication protocol, verification of a received update file no longer requires both peers to use the same approach to subscription hashing. (#12672)

🔄 **Changed:&#x20;**&#x45;xperimental multihop connectivity is more resilient to mesh disruptions (#13648)

🔄 **Changed:&#x20;**&#x53;ynchronization protocol enhanced to reduce the amount of redundant data sent from small peers to big peers. (#13737)

🔄 **Changed:&#x20;**&#x46;ailed certificate verification due to a lagging device clock now results in a clearer error message (#14035)

🔄 **Changed:&#x20;**&#x4D;ulticast peer-to-peer transport is no longer deprecated to improve support for environments where mDNS is unavailable (#14188)

🔄 **Changed:&#x20;**&#x52;eplication no longer redundantly re-transmits unchanged subscriptions after eviction. (#14290)

🔄 **Changed:&#x20;**&#x74;runcated peer keys are now logged in lieu of site IDs. (#14362)

🔄 **Changed:&#x20;**&#x69;mproved logging in the authentication code to provide more useful error context. (#15038)

🔄 **Changed:&#x20;**&#x6D;ade the small peer "log request" feature much more responsive (#9777)



🛠️ **Fixed:&#x20;**&#x57;indows P2P LAN now can connect to IPv6 peers (#11468)

🛠️ **Fixed:&#x20;**&#x49;n certain rare cases, resetting the same replication session multiple times could cause failure to converge. (#12616)

🛠️ **Fixed:&#x20;**&#x49;nternal connection TLS caches are now bounded in size. This prevents a long living peer from holding onto more memory than required. (#13801)

🛠️ **Fixed:&#x20;**&#x73;mall peer info "metadata" is now persisted across app launches. (#13987)

🛠️ **Fixed:&#x20;**&#x42;luetooth peers are handled better when disconnections occur, fixing a possible loop where a device might repeatedly try and fail to connect. (#14018)

🛠️ **Fixed:&#x20;**&#x57;hen replication sessions time out, write transactions on the document store may be blocked for a long period. (#14148)

🛠️ **Fixed:&#x20;**&#x4D;ulticast peer-to-peer transport (non-MDNS) is no longer influenced by TCP listen configuration in DittoTransportConfig (#14187)

🛠️ **Fixed:&#x20;**&#x61;n issue preventing attachment transfers under high document sync load is now resolved. (#14189)

🛠️ **Fixed:** A race condition that could cause attachments to unexpectedly crash under heavy load. (#14342)

🛠️ **Fixed:** device name no longer incorrectly defaults to "ditto" in small peer info, when a named device first starts syncing (#14674)

🛠️ **Fixed:** presence observers are now less-likely to fire when there is no observable change to presence data. (#14807)

🛠️ **Fixed:&#x20;**&#x4C;ogs report blocked\_by="no blocking transaction" when blocking transaction is known (#14966)

🛠️ **Fixed:&#x20;**&#x49;n-band authentication data is now cleared on logout. (#15039)

🛠️ **Fixed:&#x20;**&#x73;witching appIDs now invalidates cached authentication material correctly. (#15040)

🛠️ **Fixed:&#x20;**&#x54;ransport conditions are now reported for a wider range of failures when starting Bluetooth and mDNS transports. (#8729)

🛠️ **Fixed:&#x20;**&#x64;ocumentation for the `stopSync()` method to clarify that the Ditto store can be used locally after stopping sync. (#8849)

🛠️ **Fixed:** Auth Client would hang when cached X.509 was expired. (#15110)



⚠️ **Deprecated:**

❗️🗑️ **Removed:**&#x20;

