Flutter Release Notes
4.10.4 Security & Stability Improvements
We’ve enhanced our TLS certificate handling to provide more robust and reliable secure connections while maintaining our high security standards.
Fixed
Fixed
- Improved reliability of secure connections by gracefully handling certificate validation challenges
- Enhanced network stability with smarter handling of security certificates
- Added flexibility in secure connection handling while maintaining robust security standards
4.10.3 Stability Improvements, DQL Enhancements
We’ve enhanced our query capabilities with improved sorting and filtering for UPDATE operations, while also focusing on overall reliability improvements.
Added
Added
- Added powerful sorting and filtering capabilities to UPDATE operations, giving you more control over how you modify data on Small Peer devices
- Enhanced reliability and performance of data queries across your application
4.10.2
Changed
Changed
- No significant changes. Bumped version to 4.10.2 to align with other SDKs.
4.10.1
Added
Added
- Added support for the web platform
Fixed
Fixed
- Attachment fetchers now successfully complete the attachment fetch operation
- The
isStopped
property ofAttachmentFetcher
instances now becomestrue
after completing an attachment fetch - Resolved a memory leak that affected
QueryResult
andQueryResultItem
ditto.store.newAttachment
now returns aFuture<Attachment>
rather than an Attachmentditto.close()
now returns aFuture<void>
rather thanvoid
4.10.0 New Capabilities
Now Supporting Flutter 3.19+
Ditto’s Flutter SDK now supports Flutter 3.19 and later, broadening compatibility and making it easier for more developers to integrate Ditto into their apps. This update ensures greater flexibility, allowing teams to adopt Ditto without needing to upgrade immediately to the latest Flutter version.
Experimental Support for Hot Restart in Flutter
The Ditto team is excited to preview support for Hot Restarts in Flutter.
To allow users experiment and provide feedback on hot restarts we’ve shipped a specific SDK version with hot restarts enabled by default.
To use hot restarts update your version to 4.10.0-experimental-hot-restart.0
. This version is identical to 4.10.0
but
has Hot Restart enabled by default. In a upcoming release this capability will be integrated into Ditto’s standard package
as a developer mode config that can be set by the user on Ditto class initialization.
Flutter Dart has limited support for Hot Restarts with native binaries, such as Ditto. The Ditto team is working to mitigate these issues. If you run into any issues while experimenting with Flutter Hot Restarts reach out to Ditto Customer Support.
Known issues include:
- Logging must be disabled. To do this set
DittoLogger.isEnabled = false
immediately after callingawait Ditto.init()
. - Attempting to use attachments will cause a crash.
- Hot restarting will leak some resources, notably memory. In our testing, approximately 20-30MB is leaked per hot-restart.
- Data integrity cannot be guaranteed. You may experience data corruption when hot-restarting, which may be propagated to any peers that are being synced with.
- Sporadic crashes can occur.
4.10.0-experimental-hot-restart.0
.Small Peer User Collection Sync Scopes
User Collection Sync Scopes let you control how data from each user collection is shared with other connected Peers. This is useful when you want to fine-tune which collections do not sync, which collections sync with only Ditto Server and which collections sync only with connected Small Peer devices.
Sync scopes can be used to control how documents sync, reduce unnecessary data transfer, and improve performance.
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
Details
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. |
DQL Syntax for setting a Sync Scope
Example Setting A Sync Scope in the SDKs
In the example below we’ll set the collection local_mesh_orders
to only sync with other small peers in the mesh and not with Ditto Serverusing the SmallPeersOnly
sync scope.
Store Observers Run Multi-Threaded By Default
Ditto store observers (e.g 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
DQL Support for LIKE
operator
The LIKE
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) |
Example
DQL New Objects operators
DQL now supports two new methods for querying over the keys and values in an object.
object_keys(object)
: Returns anarray
with all the keys in the givenobject
.object_values(object)
: Returns anarray
with all the values inobject
.
DQL>Operator Expressions
DQL LIMIT/ OFFSET / ORDER BY support for mutation operators
Users can now use LIMIT
, OFFSET
and ORDER BY
in EVICT
and UPDATE
statements.
DQL Example
4.10.0 Flutter Specific Changelog
Added
Added
- Add support for Flutter 3.19 (Flutter - support 3.19 #16080)
Fixed
Fixed
- Throw an error when trying to use Ditto APIs before awaiting
Ditto.init()
(#15880) - persistenceDirectory now supports relative paths and no longer needs to exist, and also works on web (#15890)
- compiling with —wasm now works. Required for upcoming Flutter Web release. (#15991)
- LAN transport shuts down when
stopSync()
is called (#SDKS-707)
4.10.0 Common Changelog
Added
Added
-
In DQL, an element of an array can be accessed by expression. (feat: Disallow double-quoted identifiers inside of new operators #12529)
-
DQL field and element selection (DQL: Support field and element selection. #13920)
-
full support for DQL virtual collections, and the system:dual virtual collection (parser changes for virtual collections #14954)
-
On Android, logs now indicate if a missing permission is not declared in an app’s AndroidManifest.xml. (Clarify Android missing permission messages based on manifest presence #15094)
-
LIKE DQL operator. (#QE-104)
-
object_keys and object_values scalar DQL functions. (#QE-73)
-
A new system parameter network_use_nextgen_multihop_stack to switch between our existing and experimental next generation network stacks ([network] Add configurability for switching between legacy & next gen networking stacks #15362)
-
Enabled zlib certificate compression (RFC8879) for small peer TLS 1.3 session negotiation ([security] enable TLS certificate compression #15801)
-
A system parameter to selectively disable the BLE peripheral (server) transport. (New System Parameter: transports_ble_peripheral_is_enabled #15802)
-
a STORE_OBSERVERS_NUM_THREADS system parameter to tweak the number of threads used by our store observer runtime to dispatch the sdk callback invocations. (Allow different live queries to be called in parallel #15814)
-
The ability to configure a TTL for tombstones in the small peer store, which can be cleaned up via periodic sweeps from the new “reaper” module. (Finish porting the prototype tombstone reaping implementation into main #15886)
-
Support for the new DQL DELETE statement on small peers. (Stabilize the DQL DELETE statement on SP #15899)
-
A new Small Peer Info section named “reaper” and a field named “last_reap_time” that indicates the last time the tombstone reaper successfully completed its cleanup of expired tombstones. (Add small-peer-info field to track last completed reaper timestamp #16000)
-
Add support for LIMIT, OFFSET and ORDER BY for mutation statements iin DQL (feat(query/dql): Support ORDER BY, LIMIT, OFFSET in mutation statements #16020)
-
Added support for permanent system wide document deletes with the DELETE keyword in DQL for all Small Peer SDKs. This change requires a coordinated release with Ditto Server to ensure data is completely removed from the system. The Ditto Server change will be rolling out over the coming month and Ditto will be making a larger announcement upon release.
For usage on deletes prior to the larger announcement see the following documents. Note that these documents are only accessible via their direct links and will not appear in the navigation bar just yet.
For support on using deletes in your application reach out to Ditto Customer Support to get started.
Fixed
Fixed
- A rare scenario where stopping sync with in-progress TCP connections could result in a crash. (#TRANS-303)
- If Ditto’s storage is cloned to another device (not recommended), clones which connect to each other will automatically create a new Peer Key and reauthenticate so that sync can proceed (Trigger reset peer identity when another peer clearly has the same Peer Key, add integration test #14653)
- on Android, missing system permissions will no longer crash Ditto. (Check for normal permissions in DittoSyncPermissions #15233)
- Fixed initialisation failing for the Linux Bluetooth transport due to invalid dbus messages (Linux BLE baseline bugfixes #15717)
- Fix OldQL and DQL comparison between large floats and integers returning an arbitrary result (Fix OldQL and DQL comparison between large floats and integers #15949)
- Reduced duplicate notifications for authentication state changes. (auth client: validity_update only on changes #15981)
Changed
Changed
- The link_enabled system parameter has been renamed to network_enable_multihop ([network] Add configurability for switching between legacy & next gen networking stacks #15362)
- Improve authentication flow over bad connections (Auth client/server improvements around challenge tokens #15430)
- Store observers are now invoked in parallel by default. (STORE_OBSERVERS_NUM_THREADS to default to 0 = num_cpus #16064)
- Synchronization protocol enhanced to reduce re-transmission of document data and metadata after eviction. (#DS-188)