agile-ts / agile

🌌 Global State and Logic Library for JavaScript/Typescript applications
https://agile-ts.org
MIT License
95 stars 8 forks source link

Prints warning when loading persisted Collection #155

Closed bennobuilder closed 3 years ago

bennobuilder commented 3 years ago

🐛 Bug report

🤖 Current Behavior

If you store a Collection in an external Storage with some Items that were not initially added, the Collection tries to rebuild the Group on each loaded Item when loading the Collection. And since not every Item was loaded yet, a warning is printed that the Item doesn't exist in the Collection.

🎯 Expected behavior

Shouldn't print warning and rebuild the whole Group when one Item was loaded

Related to issue:

113

📄 Reproducible example

https://codesandbox.io/s/agilets-first-collection-uyi9g

When adding multiple Items to the TODO-List and then refreshing the application. You see the warning be printed, when the persisted value is loaded into the Collection.

💡 Suggested solution(s)

Fix Group rebuilds #113