Rust
4.8.3 Common Release Notes
Fixed: iOS 18 crashes related to Bluetooth LE are now resolved. (#15351)
Changed: Added more actionable information to common connection handshake issues. (#15298)
4.8.2 Rust Specific Changes
No Rust Specific Changes
4.8.2 Common Changes
Fixed: Setting the minimum log level to WARN or ERROR will now correctly filter out very early logger initialization messages. (#14451)
Fixed: A bug that could prevent an attachment created with the same data on multiple peers from syncing. (#14481)
4.8.1 Rust Specific Changes
No Rust Specific Changes
4.8.1 Common Changes
Added: The presence_use_multihop system parameter can be used to disable replicating presence information to other peers in the mesh, reducing network overhead. Use ONLY with guidance from the Ditto Customer Experience team. (#14128)
Changed: When failing to load document data sync (replication) metadata, Ditto now attempts to clear and regenerate the metadata. This is a behavior change where previously Ditto would fail to start. This serves to prevent problems after SDK version downgrades. (#13111)
Fixed: A rare issue where attachments may not be transferred between two peers.(#14158)
Fixed: On-disk logs are more robust in situations with unexpected Ditto shutdown. (#13723)
The Ditto 4.8.0 Rust SDK release brings significant reliability enhancements, ensuring that Rust now stands on par with our other supported languages. This update focuses on stabilizing key features and improving overall performance, making the Rust SDK more robust and dependable for developers. Whether you’re building new projects or maintaining existing ones, these enhancements will provide a smoother and more consistent experience.
4.8.0 Rust Specific Changes
Added: BLE support on macOS #12639
Added: DittoLogger type, and moved all the Ditto logging APIs to it #12793
Added: function export_to_file() to DittoLogger, which exports collected logs to a compressed and JSON-encoded file on the local file system. Logs returned through this method are at DEBUG log level. This new API can be used to do forensic log gathering on a device. Logs are always collected and restricted to a fixed specific size limit to ensure they don’t grow endlessly. Once the size limit has reached new logs replace the oldest logs. #11961
Added: Store::new_attachment_from_bytes function for creating a new attachment from in-memory data #12548
Added: Properties peer_key_string1 and peer_key_string2 on Connection replacing the deprecated properties peer1 and peer2 #12799
Added: PartialEq implementation for Peer and PresenceGraph #12943
Added: V3ConnectionType public type to allow internal access to a presence peer’s connection type. #12945
Added: Documentation for start_sync() and disable_sync_with_v3() to include a recommendation for performance improvement. #13098
Performance of initial sync when bootstrapping a new peer can be improved by calling disableSyncWithV3() before calling startSync().
Only do this when all peers in the mesh are known to be running Ditto v4 or higher. Added: Documentation for property peer_metadata on Peer to add information about how the property behaves over the lifecycle of the PresenceGraph #13479
Added: Connection type replacing the UndirectedConnection type.
Added: register_observer_with_signal_next API to the Ditto store namespace to allow for users to control observer callback rate in advanced usage scenarios. #13397
Changed: The format of logs emitted by the Rust SDK is now more consistent #12557
Fixed: Ditto Rust SDK no longer requires a fixed version of Rust. Previously users of Rust needed to bind their Rust version to the version used by Ditto. Going forward this is not longer the case and users need only support the minimum version of Rust required by the Ditto SDK.
Fixed: register_observer delivering the same events multiple times #13397
Fixed: Static linking issues that used to require setting LIBDITTO_STATIC_AMEND_WITH=objcopy #12203
Fixed: mDNS not advertising on macOS #12639
Fixed: Various improvements to the error module and types in the API #12793
Fixed: Rust SDK may create an extra unneeded TCP listener when peer-to-peer LAN sync is enabled #13497
Fixed (Linux): Increased mDNS multicast TTL from 1 to 255 to allow for cross-VLAN announcements #13590
Deprecated: LIBDITTO_STATIC_AMEND_WITH build.rs script environment variable, since the reason why it was previously needed have been resolved #12203
Deprecated: ErrorKind::as_str() API. Please use its Display implementation instead. #12793
Deprecated: The logging APIs on the Ditto type. Use the DittoLogger instead. #12793
Deprecated: Properties peer1 and peer2 on Connection, please use peer_key_string1 and peer_key_string2 instead #12799
Removed: A few APIs and types unitentially exposed under ::dittolive_ditto::error. #12793
Breaking change: transports::v3::ConnectionType moved to transports::ConnectionType, please update any necessary imports. This was necessary because transports::v3::ConnectionType was a stop gap solution to resolve an immediate customer pain point.
Breaking change: UndirectedConnection type renamed to Connection.
4.8.0 Common Changes
Changed: The Logging output format for Ditto SDKs has been changed in 4.8.0 as part of our process to improve readablility and observability across the Ditto platform. Customers should validate the new data format in their existing data ingestion pipelines.
New Logging Schema:
YYYY-MM-DDTHH:MM:SS.ssssss LEVEL TARGET: MESSAGE {field1=value1, field2=value2, ...}
-
Timestamp (YYYY-MM-DDTHH:MM.ssssss):
-
Format: ISO 8601 format (e.g., 2024-08-16T14:23:05.123456Z).
-
Description: The exact time when the log entry was generated.
-
Log Level (LEVEL):
-
Format: One of the following levels— DEBUG, INFO, WARNING, ERROR.
-
Description: Indicates the severity or importance of the log entry.
-
Target (TARGET):
-
Format: A string, representing the internal module/area
-
Description: The source of the log entry, often corresponding to the internal module where the error was called. (e.g. ditto_init or peer_event_listener)
-
Message (MESSAGE):
-
Format: A human-readable string.
-
Description: The main content of the log entry.
-
Structured Fields
({field1=value1, field2=value2, ...}):
-
Format: A list of key-value pairs enclosed in curly braces.
-
Description: Any additional structured data associated with the log entry. These fields can include custom data that you attach to the log entry using the tracing::info!(field1 = value1, “Message”) syntax.
4.7 and earlier Logging Format Example
[INFO] 2024-08-02T10:25:39.981Z: AuthClient: using cached SiteId; site_id = 16248337916605943930
4.8.0 and later Logging Format Example
2024-08-02T11:32:25.905562+01:00 INFO ditto_init:new_auth_client: ditto_auth: using cached SiteId site_id=16248337916605943930
Added: DQL support for string functions byte_length and char_length #12147
Added: DQL support for inline object and array literal creation #12312
Added: object_length and deserialize_json functions in DQL #12605
Added: DQL INSERT statements support inlining the construction of an object #12761
Added: Remote query capability allows Big Peer to execute read-only queries on Small Peers. Usagne currently internal to Ditto Customer Experience team members #12268
Added: Diagnostics are now provided when collecting Small Peer Info on-disk logs #12080
Added: output version, sdk and build information on startup for easier debugging #12845
Added: Introduced new internal capabilities ensure a large data payload (e.g. a large attachment file) cannot use all the bandwidth and prevent other data from being synced.
Added: mDNS transport can now be configured with a static port for the TCP server using the tcp_server_bind_mdns_server_port system parameter #13442
Changed: New logging format that includes detailed information #10794
Changed: The Ditto logger is now more verbose by default, with a minimum log level of INFO instead of WARNING #11141
Changed: small peer info collection is now enabled by default and its default sync scope is now BigPeerOnly #12709 (Device dashboard will populate information automatically)
Changed: (Experimental) Multihop connections are formed more efficiently, e.g., for Ditto Bus. This is an incompatible protocol change from previous versions #12108, #12623
Changed: Improve performance by avoiding deserializing the entire Document if only part of it is required #10887
Changed: Attachments now sync independently of documents, improving rainbow connection efficiency #11156
Changed: Updating several depdencies for security patching (Patch multiple old packages #12087)
Changed: How network OS capabilities are internally linked into the library to allow for more relaiable and reusable internal logic #12362
Changed: API documentation for execute method to include information about its interaction with sync subscriptions #12365
Changed: Default to creating backup Bluetooth connections when there is an existing WiFi connection (Default mesh_chooser_avoid_redundant_bluetooth to false #13398)
Changed: console logging will now output to STDERR instead of STDOUT ([logs] logging now outputs to STDERR instead of STDOUT #13477)
Fixed: Bytes and Arrays not being always comparable in the legacy query language #10887
Fixed: Legacy query language casting counters and maps with tombstones to the wrong boolean value #10887
Fixed: Lowered the log level of a few SQLite3 notices that were being unnecessarily logged as warnings #12032
Fixed: A crash that can occur if a DQL query contains a multi-byte character #12324
Fixed: An issue with the transports multiplexer that could lead to a hung process. This occured when dealing with large messages spanning multiple chunks (>64KB) #12428
Fixed: A rare edge case that could slow down data sync betten peers #12527
Fixed: Frequent subscription changes along with eviction calls could cause failure to converge on data leading to inconsistent data state #11431
Fixed: Memory leak in third party library used for peer-internal messaging #12895
Fixed: Transport inactive connection tracking no longer stores identifiers indefinitely. This could lead to a slow growth in memory consumption for long lived applications (~ 1MB/day on transports with high rate, unreliable discovery - such as BLE) #13147
Fixed: Unexpected failures to obtain a certificate for peer-to-peer sync are now logged at ERROR level instead of WARNING #13323
Removed: (Experimental) Ditto no longer supports the experimental Query Overlap Groups feature and support has been removed. This experimental feature has been removed after running a determining a lack of feasability in production scenarios. The team is iterating and plan on interoducing improved capabilitites. #13075