JavaScript | Web and Node.js | React Native
4.8.3 React Native Specific Changes
Changed: Error messages and documentation for APIs not supported in React Native environments. Some parts of the SDK’s API, in particular the original query builder APIs, are not supported and throw errors when called from a React Native app. In these cases, error message wording and documentation has been improved to make it easier to find the right replacement APIs to use instead. (#14612)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 JavaScript Specific Changes
Fixed: Missing API reference for class UpdateResult. (#14611)
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 JavaScript Release Notes
Fixed: Prevent race condition that can cause attachment fetchers to fail being cleaned up. (#13961)
Fixed: a memory leak affecting attachments downloaded using the legacy query builder API. (#13819)Fixed: iOS devices may fail to sync on LAN when the app is backgrounded then foregrounded. (#14150)
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 version 4.8.0 SDK release update brings a substantial number of improvements and new features designed to enhance your development experience and provide even more powerful tools for building robust, real-time applications.
4.8.0 JavaScript Release Notes
Added: Method exportToFile() to Logger, 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: Properties peerKeyString1 and peerKeyString2 on DittoConnection replacing the deprecated properties peer1 and peer2 #12799 Added: Documentation for startSync() and disableSyncWithV3() to include a recommendation for performance improvement. #13098Performance 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 peerMetadata on DittoPeer to add information about how the property behaves over the lifecycle of the DittoPresenceGraph #13479 Changed: DQL methods now use generics for improved type safety and better IDE support. This change affects the Ditto Store’s methods execute(), registerObserver(), registerObserverWithNextSignal(), its observers field, as well as the related types QueryResult, QueryResultItem, StoreObserver, StoreObservationHandler, and StoreObservationHandlerWithSignalNext. In the Sync class, the method registerSubscription() and the subscriptions field are updated, as well as the related SyncSubscription class. Type generics are added in a backwards-compatible manner by providing default types with wide bounds. Changed: Ditto.runGarbageCollection() is now an async method, which allows awaiting the completion of manual garbage collection. #8743 Fixed: Errors that occur while running manual garbage collection with Ditto.runGarbageCollection() are now thrown. #8743 Fixed: Ditto logger is now initialized when first constructing a Ditto instance, when it used to be initialized on calling init() in browser environments and on import of the SDK in other environments. This fixes an issue where it was not possible to set the logger’s verbosity level before logging began. #12719 Deprecated: Properties peer1 and peer2 on DittoConnection, please use peerKeyString1 and peerKeyString2 instead #127994.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 #10887Fixed: 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. #13075Was this page helpful?