synquill 0.9.1
synquill: ^0.9.1 copied to clipboard
Offline-first Flutter data engine with background JSON API sync and custom retry logic.
0.9.1 #
Changed #
- Moved Synquill's internal test models and generated fixture database out of
the runtime package and into
test/support. - Disabled Synquill's own aggregate code generation target so
dart run build_runner buildno longer recreates runtimelib/synquill.generated.dartfixture output for thesynquillpackage.
Migration note #
- Applications should import their own generated file, for example
package:your_app/synquill.generated.dart, notpackage:synquill/synquill.generated.dart. - Code importing
package:synquill/src/test_models/...orpackage:synquill/generated/database.generated.dartwas depending on internal test fixtures and should move to app-owned models or test support fixtures.
0.9.0 #
Added #
- Added
@SynquillIdKeyto mapSynquillDataModel.idto custom API JSON keys such asplaceId. - Models using
json_serializablecan now rely on@JsonKey(name: ...)on theidfield; Synquill infers the same custom id JSON key automatically unless@SynquillIdKeyis present. - Retry sync now resolves queued task identity from the configured custom id
key, payload
id, thensync_queue_items.model_id.
Fixed #
- Local-first retry processing no longer fails when
toJson()omits a literalidkey but the queued row already stores the model id. - Server-generated ID replacement now honors the configured API JSON id key before rebuilding a model from JSON.
0.8.3 #
Changed #
watchOne(id)is now passive by default and no longer inheritsdefaultLoadPolicy; useloadPolicy: DataLoadPolicy.localThenRemoteexplicitly when a remote refresh is required.
Fixed #
watchOnenow followsRepositoryChange.idChangedevents so active watches move from temporary client IDs to server-generated IDs.watchOne(watchRemote: true)now rebinds realtime subscriptions after an ID change.- Generated relation watch paths avoid unnecessary ManyToOne re-subscription churn when the source model changes but its foreign key does not.
0.8.2 #
- Resolve critical runtime and generator issues.
0.8.0 #
New Features #
- Introduced realtime synchronization support for repositories via
RepositoryRealtimeOperationsmixin. - Extended repository
watchOneandwatchAllmethods with a newwatchRemoteparameter and automated retry logic (retryOnFail). - Added transport-neutral
RealtimeEventandRealtimeEventTypemodels for processing remote updates. - Added
RealtimeApiAdapterinterface to define standard subscription contracts. - Enhanced
RepositoryChangewithrealtimeErrorfactory constructor for unified error propagation.
0.7.2 #
- Fixes imports.
0.7.1 #
- Fixes imports. Fixes typos in
synquill_gen
0.7.0 #
Breaking Changes #
BaseDaoMixin<T>interface now requires implementations forsaveModel,deleteById,deleteAll, andgetAllExcludingIds. Custom DAOs must be updated.- Migrated the monolithic
part/part ofstructure to modular libraries usingimport/export. Internal code moved tolib/src/for true compile-time encapsulation. Consumers relying on internal package visibility or private members will need to update their code.
Improvements & Optimizations #
- Type Safety: Eliminated all
dynamicdispatch inRepositoryHelpersMixinby leveragingBaseDaoMixininterface. - Performance: Optimized
fetchAllFromLocalWithoutPendingSyncOpsto use a single SQLNOT INquery instead of N+1 per-item checks, improving performance by orders of magnitude for large datasets. - Reliability: Added atomic transaction to
obliterateLocalStorageto guarantee data consistency even if the app crashes or device loses power mid-operation. - Sync Engine: Added bulk operation support to
SyncQueueDaofor faster queue clearing and pending status detection.
Bug Fixes #
- Fixed critical type safety in
SynquillStorageConfig(diotyped asDio?,maximumNetworkTimeoutasDuration). - Fixed logic errors in
loggerandbackgroundSyncManagerinitialization guards. - Prevented listener leaks and duplicate logs by making
_defaultLoggerastatic finalfield. - Fixed
NetworkTask.isCancelledto correctly distinguish between explicit cancellation and completion.
0.6.0 #
Breaking Changes #
methodForFindand allurlForFind*methods now support aQueryParamsparameter, enabling adaptive API method and URL selection based on query complexity.- The
typegetter inApiAdapterBasenow returns the snake_case type name by default instead of lowercase, which may affect endpoint URLs and serialization logic.
0.5.5+1 #
- Correctly implemented
localOnlyrepositories in mixins.
Note: code must be re-generated via build_runner
0.5.4 #
- Fixed a bug where
localOnlyrepositories might throw an error duringremoteFirstoperations.
0.5.3 #
- Fixed a bug where pending operations did not respect parent ID changes.
0.5.2 #
- Initial release.