Release Notes
Swift
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 even if your app uses legacy crdts, you'll benefit from this backward compatible change 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 fetching attachment tokens previously, dql queries were limited in their ability to retrieve the pointer that ditto uses to fetch your attachment object now you can query the following additional fields to improve query capabilities detail description attachment 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) blob length the size of the blob data in terms of length ( len ) in bytes (see blob store) following is an example document showing the fields added in this release { " 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 replacement for deprecated getdata() method now, when accessing attachments, use the new data() api method on dittoattachment added jsondecoder functionality for dittoqueryresultitem class we've added the jsondata() method that, once invoked, returns a data object that you can use to integrate the results into your json decoding workflows added fetchattachment() and fetchattachmentpublisher() these new variants accept an attachment token dictionary representation provided by the value of dittoqueryresultitem 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 dittostore class with a new api method for creating attachment objects newattachment() this new way of creating attachments comes with improvements, such as asynchronous 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 changed log level for dittocollection class (deprecated) calls made to the newattachment() method on the recently deprecated dittocollection class now log at the error log level 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 the token is now provided as a dictionary of the form \["id" " ", "len" 123, "metadata" ] where metadata is a dictionary\[string string]` fixed issues related to the presence graph there was an issue where dittopresence graphpublisher and ditto remotepeerspublisher (deprecated) sent data to a subscribing peer before they were ready to receive it (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