Release Notes
Java - Android
4 6 version release added support for runtime configuration using dql ditto introduced an experimental feature for retrieving, configuring, and restoring default configurations for the ditto peer to peer system at runtime using ditto query language (dql) syntax the customer experience team offers this feature to customers when appropriate for your scenario and use case through two new statements alter system and show , you can change parameters, settings, and configurations while your peer to peer system is actively running fixed accumulation of unsubscribed documents due to recent improvements to the sync protocol, small peers no longer accumulate unsubscribed documents when subscription statuses are changed this fix ensures that the peer to peer system prevents retaining unnecessary data, resulting in optimized resource usage changed sync protocol to streamline the sync process ditto's recent adjustments to the sync protocol have decreased the exchange of redundant data during re synchronization, improving the efficiency and stability of the sync process changed sync protocol so peers use the latest version ditto decoupled sync protocol from conflict free replicated data types (crdts) so peers now prioritize using the latest supported protocol version for data exchange this change is backward compatible, so even if your app uses legacy crdts, you'll benefit improved api reference for sort() method the documentation for the sort() api method on cursor operations has been updated to provide clearer explanations of behavior in cases where the specified field for sorting is missing improved parser error messages now, parser error messages focus more on indicating the location of errors within the input code, rather than suggesting potential fixes with this improvement to the api reference, you have better guidance in debugging your code fixed an issue where ditto link could enter an infinite loop this fix addresses a specific bug where ditto link could go into a "forever loop" under certain conditions this loop, caused performance issues and could potentially lead your app crashing fixed inconsistent handling of legacy query builder apis before this fix, there were issues with incorrect casting to boolean values, leading to inconsistent behavior this update ensures that values are cast properly, resulting in consistency across your app added comparison operations for legacy query builder apis if you're using legacy crdts in your app, now you can perform comparisons with attachment objects fixed limitation in querying attachment tokens previously, dql queries were limited when retrieving the pointer, or attachment token , ditto references to fetch its associated attachment object holding the binary large object (blob) storing the binary contents representing the actual binary data being stored, such as a large image file now you can query the following additional fields property description id a cryptographic hash of the attachment's contents (see organizing by id and attachment token) metadata additional information about the attachment, such as its name, type, and so on (see attachment token) len the size of the blob data in terms of length ( len ) in bytes (see blob store) following is an example document showing these new fields { " id" "abc123", "make" "hyundai", "year" 2018, "color" "black", "picture" { "id" "\<unique identifier>", "metadata" { "mime type" "image/jpeg", "name" "car stock photo jpg", }, "len" 123 } } fixed error handling when creating an attachment we've improved error handling mechanisms to manage input output (io) errors that may result during the creation of attachment objects now you'll receive clearer feedback when encountering errors so you can prevent potential crashes and improve the overall stability of your app fixed internal data decoding functions fixed improved internal data decoding functions to prevent api crashes under certain inputs we've improved the software component for handling tasks such as byte parsing, character decoding, and data type conversion instead of crashing, like before, the api returns an error fixed issues causing crashes when preparing to sync there were issues causing app crashes during the preparation phase for syncing data to remote peers with these improvements, the likelihood of encountering errors during syncing has been significantly reduced added convenience methods for executing queries the following synchronous methods are now available in the dittostore java api dittostore execute(string) dittostore execute(string, map) with these methods, you can execute queries in a blocking way this means that operations can be delayed until the query completes and returns the result; for example, in response to end user interaction, like a profile update, in your app added fields for read only access to observer query with the latest update to the java api classes dittostoreobserver and dittosyncsubscription , you now have read only access to the following fields querystring queryargument use querystring to retrieve the string associated with a ditto store observer or a sync subscription similarly, use queryargument for visibility into associated arguments, if any added new method overload to simplify code with the following new method overload for registering store observers, you no longer have to pass unnecessary argument parameters new dittostore registerobserver(string, dittochangehandler) added replacement dittostore class for working with attachments previously, you'd create attachments using a method in the dittocollection class, which has since been deprecated new method for creating attachments this release rolls out a replacement class dittostore class with a new api method for creating attachment objects newattachment() this new way of creating attachments comes with improvements, such as asynchronous or, in kotlin, suspendable ( suspend ) execution meaning, it does not block your main thread new property for managing fetching with the attachmentfetchers property, keep track of ongoing attachment fetching operations new mechanism for handling fetching related errors if there are any issues fetching attachments, the fetchattachment() method now throws dittoerror new document field properties for identifying attachments the following new properties that you can query to increase the efficiency of fetching operations property description id a cryptographic hash of the attachment's contents metadata additional information about the attachment, such as its name, type, and so on len the size of the blob data in terms of length ( len ) in bytes new method for retrieving length of attachments the getlength() method provides a way to determine how large an attachment is in terms of its bytes added javadocs jar artifact for local access to api references with this addition, you can access reference information about ditto api's classes, methods, and so on from your ide the javadocs jar artifact is available in the dittopresenceviewer module of the ditto sdk to enable access in your ide, specify the artifact's location in your project settings added accessors for properties in the dittoglobalconfig class previously, the syncgroup and routinghint properties in the dittoglobalconfig class were represented as unsigned 32 bit integers ( uint ) they've been redefined as long integers so you can hold a much larger range of values in these properties, which are represented as of this release as 64 bit signed integers fixed issue related to attachment token schema we fixed an issue related to the structure representing attachment tokens provided by the value of dittoqueryresultitem so that the schema accurately represents the content of attachment tokens now the token is structured within the document as a map object in the form of \["id" " ", "len" 123, "metadata" ] , where metadata is a map\<string, string> (experimental) fixed issue with mutual link connections two peers targeting each other simultaneously in ditto bus or query overlap groups, known as mutual link connections , no longer struggle to establish a multihop connection to participate in the flood fill process