Closed lberbey closed 8 months ago
Thanks for reporting, I could verify your project fails as expected.
Things I should look into:
Shop
it doesn't on Recipe
)Hi,
Thanks for answering that fast.
For your second point, I believe the issue is on read and not on write (or maybe on both...). As you can see in my first capture (original post), I've added the assignation of dbLunchMenu
and dbDinnerMenu
to WATCH view. Values of the two lists seems to be accessible before the assignation of dbLunchMenu
.
I've tried adding a new property List<String>
dbZZZ
which is read and loaded between dbLunchMenu
and dbDinnerMenu
. Same results and maybe worst : Both dbZZZ
and dbDinnerMenu
aren't assigned.
I tried to switch properties assignment order and it seems to do something : with the order dbZZZ
, dbDinnerMenu
, dbLunchMenu
and dbZZZ
equal to ['test']
, dbDinnerMenu
is also set. Even with dbZZZ
equals to [db.generateString(300), db.generateString(700)]
it worked.
I could isolate the issue: the problem is that as part of setting some properties a database query is executed. This query will run while an object is getting read. This will cause wrong values to be read.
In your code look at the RecipeIngredient.fromDB
factory. Removing the database queries there fixes your reported issues.
I still need to investigate if this is something that should work or should throw an error.
Thank you for the work. I understand why I wasn't able to reproduce it only with String.
Correct me if I'm wrong : If I had create all the missing objects (Section, RecipeIngredient...) with the proper ToOne/ToMany relations it would be ok. My issue is all about having one or many read operations during another one.
For my own good, I hope you will improve the tool but I would understand if you don't. I guess it's a lot of work and the community doesn't really need it, otherwise it would have been brought up sooner.
We have released version 2.2.0
which should resolve this issue. Please update using flutter pub upgrade
(or dart pub upgrade
for Dart Native projects).
Thanks you for the update. Does the new version fix both issues (query and read operation) ?
I've updated my sandbox project as requested and recipes = db.getManyByUuid(...
on main.dart l.187 stills returns me 1 object. For the other issue I can confirm that days[0]
is now filled with the appropriate values.
Thanks! I just verified and this is true. The issue only appears when running a query as part of constructing an object and then querying for those objects.
The query then will only return one object, regardless of how many objects are in the box.
I need to have another look at this.
We have released version 2.2.1
which I verified resolves this issue with the example project you have given. Please update using flutter pub upgrade
(or dart pub upgrade
for Dart Native projects).
Thanks again!
Many thanks for your work and time. Everything is fine !
Hi guys,
First of all, sorry for my english (I'm french).
I have two issues on the same project :
Sorry if I'm wrong. Your product is really good and quite easy to use. I'm really happy with it. I tried to understand sub classes process to fix this but guys, I'm just a simple developer and all the work on ByteArray, Buffer... is far to complex for me 👼 .
Basic info:
flutter pub deps --no-dev
flutter doctor -v
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2) • Android SDK at C:\AndroidSDK • Platform android-33-ext4, build-tools 33.0.2 • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619) • All Android licenses accepted.
[√] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.24) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community • Visual Studio Community 2019 version 16.11.33328.57 • Windows 10 SDK version 10.0.20348.0
[√] Android Studio (version 2022.1) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)
[√] VS Code, 64-bit edition (version 1.80.1) • VS Code at C:\Program Files\Microsoft VS Code • Flutter extension version 3.68.0
[√] Connected device (4 available) • M2002J9G (mobile) • 1eabc81d • android-arm64 • Android 12 (API 31) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [version 10.0.19045.3086] • Chrome (web) • chrome • web-javascript • Google Chrome 115.0.5790.110 • Edge (web) • edge • web-javascript • Microsoft Edge 115.0.1901.188
[√] Network resources • All expected network resources are available.
• No issues found!
main.dart l.187 main.dart l.191 main.dart l.194 objectbox.g.dart l.465 objectbox.g.dart l.469