Skip to content

Commit a3b21eb

Browse files
committed
1.5.13
1 parent 38afe2c commit a3b21eb

5 files changed

Lines changed: 19 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [1.5.13] - August 16th, 2023
4+
5+
- Fix: Flush Hive on relationship save
6+
37
## [1.5.12] - June 16th, 2023
48

59
- Feature: Optionally prevent client closing in `sendRequest`

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ Fully compatible with the tools we know and love:
169169

170170
![logos](https://user-images.githubusercontent.com/66403/115444364-79053f80-a1e2-11eb-9498-ee86718a4be5.png)
171171

172+
- [Drexbible](https://snapcraft.io/drexbible)
173+
172174
## ➕ Questions and collaborating
173175

174176
Please use Github to ask questions, open issues and send PRs. Thanks!

lib/src/model/relationship/relationship.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ abstract class Relationship<E extends DataModelMixin<E>, N>
6060
inverseMetadata: _inverseName,
6161
notify: false,
6262
);
63+
_graph.box!.flush();
64+
6365
_uninitializedKeys!.clear();
6466

6567
return this;
@@ -74,6 +76,8 @@ abstract class Relationship<E extends DataModelMixin<E>, N>
7476

7577
_graph._addEdge(_ownerKey!, value._key!,
7678
metadata: _name!, inverseMetadata: _inverseName, notify: false);
79+
_graph.box!.flush();
80+
7781
if (notify) {
7882
_graph._notify(
7983
[_ownerKey!, value._key!],
@@ -100,6 +104,8 @@ abstract class Relationship<E extends DataModelMixin<E>, N>
100104
inverseMetadata: _inverseName,
101105
notify: false,
102106
);
107+
_graph.box!.flush();
108+
103109
if (notify) {
104110
_graph._notify(
105111
[_ownerKey!, value._key!],

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flutter_data
22
description: >
33
The seamless way to work with persistent data models in Flutter. Inspired by
44
Ember Data and ActiveRecord.
5-
version: 1.5.12
5+
version: 1.5.13
66
homepage: https://github.com/flutterdata/flutter_data
77
documentation: https://flutterdata.dev/
88

@@ -18,7 +18,7 @@ dependencies:
1818
crypto: ^3.0.1
1919
equatable: ^2.0.2
2020
glob: ^2.0.1
21-
hive: ^2.0.4
21+
hive: ^2.2.3
2222
http: ^0.13.3
2323
inflection3: ^0.5.3+2
2424
json_annotation: ^4.8.0

test/mocks.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ class FakeBox<T> extends Fake implements Box<T> {
3434
}
3535
}
3636

37+
@override
38+
Future<void> flush() async {
39+
// no-op
40+
}
41+
3742
@override
3843
Map<dynamic, T> toMap() => _map;
3944

0 commit comments

Comments
 (0)