ENABLE_ATTACHMENT_PERMISSION_CHECKS
ALTER SYSTEM parameter to be set to false
to avoid certain rare cases of attachment fetcher hanging (#18016) Fixed: Network connections close gracefully when Ditto is stopped. (#18053) Fixed: The system:data_sync_info
collection may briefly report sync immediately after connecting (#18137)Other: improve error reporting for document (de)serialization (#18165) Fixed: Live queries being unable to use indices. (#DS-447) Fixed: Use of DISTINCT with ORDER BY & OFFSET/LIMIT. (#QE-281)libdittoffi.so
) included$LIBDITTOFFI_PATH
environment variableSSLKEYLOGFILE
for debugging TLS connectionssystem::data_sync_info
virtual collection for sync diagnosticstransports_discovered_peers
system parameter to dynamically update peers discovered out-of-band (#17009)system::indexes
virtual collection for viewing DQL indexes on small peers (#17011)SSLKEYLOGFILE
for inspecting network traffic in tools like Wireshark (#17029)UPDATE_LOCAL_DIFF
id conflict strategy for INSERT statements (#17310)transports_tcp_so_nodelay
system parameter to control TCP_NODELAY for TCP and TCP-based websockets connections (#17673){"#index":...}
(#QE-255)DittoSwiftError
> StoreErrorReason
> persistenceDirectoryLocked
which is now thrown by Ditto.open()
or Ditto.openSync()
instead of crashing. Deprecated: DittoRemotePeerV2
and DittoPeerV2Parser
are now obsolete. (#16099) Deprecated: The address
property of DittoPeer
and the corresponding type DittoAddress
, please use peerKeyString
instead. (#16099)- Deprecated: The siteID
property of Ditto
has been deprecated in favor of peerKeyString
on DittoPeer
. (#16100) Added: DittoConfig
— (Preview) a unified configuration struct that encapsulates all initialization parameters for Ditto. Required by the new Ditto.open(config:)
and Ditto.openSync(config:)
factory methods. This API will become the standard way to initialize Ditto instances in v5. Added: Ditto.open(config:)
— (Preview) an async, fallible factory method for creating Ditto instances, alongside the synchronous convenience variant Ditto.openSync(config:)
. These will replace all previous initializers in v5. Added: DittoAuthenticationExpirationHandler
— (Preview) an async closure-based handler for authentication expiration events. This provides a modern, Swift-native alternative to the DittoAuthenticationDelegate
protocol and will replace it in v5. Added: DittoAuthenticationProvider
— (Preview) a type-safe struct for specifying authentication providers, using the extensible-enum pattern. Supports both built-in and custom providers in a consistent and ergonomic way in v5. Added: Ditto.config
— (Preview) a read-only property to access the configuration used during initialization of a Ditto
instance. This will be the standard way to access configuration in v5. Added: DittoAuthenticator.expirationHandler
— (Preview) a closure-based replacement for the delegate
property, offering a more modern approach to handling authentication expiration events. This will replace the delegate pattern in v5. Added: DittoSwiftError
> validationError
> invalidDittoConfig(message:)
— A validation error reason signaling an invalid DittoConfig
. Added: DittoSwiftError
> authenticationError
> expirationHandlerMissing(message:)
— An authentication error reason signaling that the DittoAuthenticationExpirationHandler
needs to be set. Added: Ditto.absolutePersistenceDirectory
— a read-only property that returns the absolute file path to the persistence directory, replacing the now deprecated Ditto.persistenceDirectory
. Deprecated: Ditto.persistenceDirectory
— replaced by Ditto.absolutePersistenceDirectory
which guarantees an absolute file path. Added: Ditto.defaultRootDirectory
— a static property that returns the default base directory used to resolve the effective persistence directory path when DittoConfig.persistenceDirectory
is nil
or given as a relative path. - Fixed: a breaking change introduced in 4.11 where the execute()
method of DittoStore
no longer accepted nil
for the arguments
parameter. (SDKS-1313) Added: enum DittoPeerOS
representing the operating system of a peer. Added: property osV2
to DittoPeer
providing the operating system as a DittoPeerOS
enum value. Deprecated: property os
of DittoPeer
, use newly added osV2
instead.- Added: property metadataJSONData
to DittoSmallPeerInfo
as a replacement for metadataJSONString
. (#SDKS-1008) Added: method setMetadataJSONData()
to DittoSmallPeerInfo
as a replacement for setMetadataJSONString()
. (#SDKS-1008) Deprecated: property metadataJSONString
of DittoSmallPeerInfo
, use newly added metadataJSONData
instead. (#SDKS-1008) Deprecated: method setMetadataJSONString()
of DittoSmallPeerInfo
, use newly added setMetadataJSONData()
instead. (#SDKS-1008) Deprecated: method jsonString()
of DittoQueryResultItem
, use jsonData()
instead. (#SDKS-1008) Added: method DittoSync.start()
replacing the now deprecated Ditto.startSync()
. (#SDKS-1311) Added: method DittoSync.stop()
replacing the now deprecated Ditto.stopSync()
. (#SDKS-1311) Added: property isActive
to DittoSync
replacing the now deprecated Ditto.isSyncActive
. (#SDKS-1311) Deprecated: method startSync()
of Ditto
, use newly added DittoSync.start()
instead. (#SDKS-1311) Deprecated: method stopSync()
of Ditto
, use newly added DittoSync.stop()
instead. (#SDKS-1311) Deprecated: property isSyncActive
of Ditto
, use newly added DittoSync.isActive
instead. (#SDKS-1311)- Added: property isEnabled
to class DittoLogger
replacing the now deprecated enabled
. (#SDKS-1311) Added: deprecated typealias DittoSwiftError
, pointing to the now named DittoError
. (#SDKS-1311) Changed: renamed DittoSwiftError
to DittoError
throughout the SDK. DittoSwiftError
is now a deprecated typealias. (#SDKS-1311) Deprecated: property enabled
of DittoLogger
, use newly added isEnabled
instead. (#SDKS-1311) Deprecated: property sdkVersion
of Ditto
, use version
instead. (#SDKS-1311) Deprecated: property emojiLogLevelHeadingsEnabled
of DittoLogger
. Support for emoji log level headings is being phased out. (#SDKS-1311) Deprecated: method runGarbageCollection()
of Ditto
. Explicit trigger for garbage collection is being phased out. (#SDKS-1311) Deprecated: method setLogFile()
of DittoLogger
, use export(to:)
instead. (#SDKS-1311) Deprecated: method setLogFileURL()
of DittoLogger
, use export(to:)
instead. (#SDKS-1311) Deprecated: method loginWithCredentials()
of DittoAuthenticator
, use login()
instead. (#SDKS-1311) Added: read-only property commitID
to class DittoQueryResult
. (#SDKS-1339)- Deprecated: property syncScope
of DittoSmallPeerInfo
. Will be removed in version 5. (#SDKS-911) Deprecated: Legacy Query Builder. Use DQL (Ditto Query Language) instead.DQL Strict Mode
DQL_STRICT_MODE=false
), Ditto is more flexible and will infer the CRDT type based on the document’s shape:Differ
API for calculating diffs between query results.
This API can be used with a store observer to understand how its results change
over successive callbacks. The Differ
API provides a way to track changes in
the data and can be used to optimize data synchronization and conflict resolution.Differ API documentation.Feature | Description | Example |
---|---|---|
UNSET clause | Remove fields from documents | UPDATE orders UNSET items.abc WHERE _id = 'my-id' |
CAST function | Explicitly convert between data types | SELECT * FROM products WHERE CAST(price AS INT) > 10 |
USE IDS clause | Direct document retrieval by ID | SELECT * FROM products USE IDS '123', '456' |
SIMILAR TO | Pattern matching expressions | SELECT * FROM products WHERE name SIMILAR TO '%phone%' |
Runtime expressions | Use expressions in object/array construction | UPDATE products SET metadata = { 'updated_at': current_timestamp() } |
Counters | Support for legacy compatible counter type | UPDATE products APPLY in_stock PN_INCREMENT BY 1.0 |
->
) are deprecated. Read more.DELETE
to remove documents.DQL_STRICT_MODE
as a system parameter to opt-out of requiring collection definitions (#16573)network_use_nextgen_multihop_stack
(#16370)transaction()
on DittoStore
allowing a DQL transaction to be performed. Added: DittoTransaction
representing an active DQL transaction. Added: DittoTransactionInfo
encapsulating information about a transaction. Added: DittoTransactionCompletionAction
representing an action to be taken upon the completion of a transaction: commit or rollback. Added: class DittoDiffer
, which calculates diffs between query results. This can be used with a store observer to understand how its results change over successive callbacks. (CORE-474) Added: class DittoDiff
to represent diffs produced by the DittoDiffer
. (CORE-474)SDK>Configuring Collection Sync
startSync()
is called USER_COLLECTION_SYNC_SCOPES
cannot be updated without
closing and reopening a new Ditto instance. This will be resolved in the next release. For more information
see Updating Sync Scopes
Sync Scope | Purpose |
---|---|
”AllPeers” (default) | Sync with both Ditto Server and other Small Peers. This is the default behavior for all collections. |
”BigPeerOnly” | Sync only with Ditto Server (Big Peer). Do no sync with other Small Peers. |
”SmallPeersOnly” | Sync only with other Small Peers. Do not sync with Ditto Server. |
”LocalPeerOnly” | Do not sync this collection to Ditto Server or other Small Peers. |
local_mesh_orders
to only sync with other small peers in the mesh and not with Ditto Serverusing the SmallPeersOnly
sync scope.ditto.store.registerObserver(...)
) will now run multi-threaded on all platforms (except for in Web Browsers)
by default. Prior to 4.10.0
all store observers would run on the same thread which could lead to performance issues for applications
with multiple store observers. Users may see performance improvements on applications using more than one store observer, especially during
high-volume usage.Ditto guarantees order sequencing for a single observer. Because observers now run in parallel there is not a guarantee for order
sequencing between observers. This behavior change should not have an impact on your application. If you have concerns or questions
about this behavior change reach out to Ditto’s Customer Support.To reset Ditto to only use a single thread for all Ditto observers use the following system parameter. For instruction on how to set
a system parameter in your specific SDK see SDK>Customizing System Settings
LIKE
operatorLIKE
operator can now be used for pattern matching of string values.DQL>Operator Expressions
Pattern | Meaning |
---|---|
% | Matches zero or more characters (like .* in regex) |
_ | Matches exactly one character (like . in regex) |
object_keys(object)
: Returns an array
with all the keys in the given object
.object_values(object)
: Returns an array
with all the values in object
.DQL>Operator Expressions
LIMIT
, OFFSET
and ORDER BY
in EVICT
and UPDATE
statements.DQL ExampleDittoIdentity.onlineWithAuthentication()
is found to be nil (i.e., when it has gone out of scope and been deinitialized). (#16051)object_keys
and object_values
scalar DQL functions. (#QE-73)
export(to:)
to DittoLogger
, which exports collected logs to a compressed and JSON-encoded file on the local file system. (#11961)peerKeyString1
and peerKeyString2
on DittoConnection
replacing the now deprecated properties peer1
and peer2
. (#12799)peer1
and peer2
on DittoConnection
, please use peerKeyString1
and peerKeyString2
instead. (#12799)- Added: TvOS platform support (#13049)queryOverlapGroup
of DittoPeer
and DittoRemotePeerV2
, always returning 0
going forward.queryOverlapGroup
of DittoExperimental
.priority(forQueryOverlapGroup:)
and setPriority(_:forQueryOverlapGroup:)
of DittoExperimental
.setQueryOverlapGroup(queryOverlapGroup:)
and setPriority(_:forQueryOverlapGroup:ditto:)
of DittoExperimental
.startSync()
and disableSyncWithV3()
to include a recommendation for performance improvement. (#13098)peerMetadata
on DittoPeer
to add information about how the property behaves over the lifecycle of the DittoPresenceGraph
. (#13479)ALTER SYSTEM
and the tcp_server_bind_mdns_server_port
config.ditto.store.execute(...)
command within your application.tcp_server_bind_mdns_server_port
needs to be set ***before ***startSync()
is called to be applied.unknown
originator.PLCrashReporter
.mesh_chooser_avoid_redundant_bluetooth
system parameter. (#12984)false
, Ditto creates Bluetooth LE connections alongside other peer-to-peer connections, serving as a fallback if the primary transport, such as Apple Wireless Direct Link (AWDL) or LAN, fails.However, before you enable the mesh_chooser_avoid_redundant_bluetooth
parameter, consider the following technical tradeoffs:mesh_chooser_avoid_redundant_bluetooth
parameter, use the following DQL query:AuthClient
by improving the log message for certificate issues returned from the Big Peer Authentication Service. (#13138)content-length: 0 header
compliance in empty POST
requests. (#12346)POST
request, the cloud load balancer would reject your request with a 411 - Length Required
error message.Now you must explicitly state that the body of your POST
request is empty by setting content-length: 0
in the header of your HTTP API call.subscribe()
on an invalid query caused sync to be silently disabled.Invalid queries in the subscribe()
method are now identified, disabled, and logged as errors.NSString
not being kept alive for the duration of the login request, leading to authentication failure and resulting in an error message stating “no auth config set up.”The fix involved guaranteeing that the provider NSString
persists for the duration of the dispatched login request, preventing premature deallocation of the string.unquoted_string
with an underscore (_
), a letter, or an alphanumeric character. For example, the following equivalent regular expression: [A-Za-z_][A-Za-z0-9_]*
.is_connected_to_big_peer
field from the Small Peer Info document. (#11883)ATTACHMENT
data type, reducing potential timeouts. (#11893)ALTER SYSTEM SET
. (#12070)SystemParameter
to configure timeouts before this fix, if using different types to encode the values representing the timeout, for instance, Milliseconds
and Seconds
, the values failed to downcast, an error log printed, and the new value ignored.Now, when using mismatched wrapper types, Ditto performs a compatibility check, validates, and, if needed, converts them as appropriate.deviceName
changes after sync start. (#11160)deviceName
property is set after the sync process has started.Previously, setting deviceName
of a Ditto instance after starting sync did not trigger a warning.This new message warns you that the new value you’ve set only takes effect after you’ve restarted the sync process in your app.deviceName
property on Ditto instances now reflects the truncation of the value to 24 bytes when starting sync. (#11160)peerMetadata
and identityServiceMetadata
to DittoPeer
. (#11611)connectionRequestHandler
to ditto.presence
, allowing filtering of incoming connections from other peers. (#11611)peerKeyString
to DittoPeer
as a replacement for the now deprecated peerKey
. ( #11611)peerKey
for DittoPeer
; use the new peerKeyString
property instead. (#11611)TransportConfig
retry interval (#12157)TransportConfig
, the retry connection interval was incorrectly set in seconds instead of milliseconds.This fix corrects the interval to properly use milliseconds instead of seconds.