GetDutchie / brick

An intuitive way to work with persistent data in Dart

Home Page:https://getdutchie.github.io/brick/#/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Converting object to an encodable object failed when adding a second item to an association

hortigado opened this issue · comments

Hi, I don't know if I'm doing something wrong but when I add a second item to a List<Association> I get this error; with the first item it works correctly. Thank you

image
image
image

Sometimes it does not throw the error but the parent document is not updated with the id of the child document. And I have to clear the cache of the app so that the updates work again

There is a strange behavior, the same thing happens when we update a document offline the first time it works and the second time editing offline no longer works because the information is not sent to the network. Once this happens, the document is damaged and no longer allows editing, unless we clear the cache of the app

Update: Adding memoryCacheProvider seems to have solved this problem. I would have to do it for tests.
memoryCacheProvider: MemoryCacheProvider(),

Hey @hortigado that is odd behavior because it appears VacunasModel may not extend OfflineFirstWithRestModel. Can you please provide the class signature for VacunasModel?

Hello @tshedor; Thanks I have managed to correct this error, it was because I had the toJson method in the class and it presented me with this error due to a null attribute.
There is another error also to take into account and that is when an error of this type occurs, either by passing an incorrect value or another problem in which the information is not saved correctly. The offline-online synchronization is broken and the next documents created offline are no longer synchronized unless they clear the application cache.

@hortigado could you please open a new issue for that? I think that's a separate issue that I'd like to debug with you but with fresh context

Correct, I close this issue.