firecmsco / firecms

Awesome Firebase/Firestore-based CMS. The missing admin panel for your Firebase project!
https://firecms.co
Other
1.13k stars 185 forks source link

List of entities not reflecting update when single entity is updated #581

Closed andreassh closed 10 months ago

andreassh commented 10 months ago

Hi,

Looks like the list of entities doesn't get updated when a single entity is updated. Only if full page is refreshed it gets updated. I would expect the entity to be updated without having to refresh the page, right? Can't find anything in the docs that adresses this

Heres a video of the behavior

https://github.com/firecmsco/firecms/assets/1119754/51c123e0-8002-4459-ae7b-c033e6d5dd95

And written as user story

As a user, if I view a list of entities where the 1st entity, has that property hasBoard = true And I open the edit drawer on the first entity And I change hasBoard = false And I hit "save and close" Then the property hasBoard is still = true on the entity list. I expect it to be false If i then hit refresh on the page Then hasBoard = false (as it should)

I'm on firecms v2.1.0

andreassh commented 10 months ago

It's worth mentioning that I'm using a custom data source. But i the displayed video, it's using the build in functionality for the entity collection methods (fetchEntity, saveEntity and so on)

fgatti675 commented 10 months ago

Hi @andreassh Thanks for the detailed report. This is not happening with the default data sources. FireCMS currently relies exclusively on data provided by the data source. The default Firebase implementation has real time updates, that's why you see it update after you have changed. You need to implement your data source in a way that is is firing events (via listenCollection or listenEntity) whenever the underneath data changes. I am closing this ticket since I don't believe it is a bug. If you need help implementing this, you can reach us at hello@firecms.co :)

andreassh commented 10 months ago

@fgatti675 Ahh okay, makes sense. Didn't know that you had to handle the updates manually or about the real time update hookups. Thanks for pointing me in the right direction.