Open slim opened 1 year ago
This is indeed a nice use case for Mercure.
In API Platform Admin we even go one step further by automatically updating the data displayed in views and in forms in real-time when they change. This could probably be achieved in EasyAdmin using Symfony UX Turbo (Turbo Streams). This would avoid having to click on the "reload" button and provide an awesome UX, but let's take it one step at a time, this functionality can always be added later.
Regarding your proposal, may I suggest a more explicit message such as The data displayed in the form is outdated (it has been changed by another user). < Reload 🔄 >
?
Also, this would be quite easy to display the list of other users currently editing the same form (similar to what Google Docs does), but again this could be done in a follow up patch.
When editing an Entity, if another user updates the same entity in the mean time, you end up overwriting his update with outdated data without knowing. Which could be an irrecoverable and undetectable data loss. Using Mercure for real-time server side push notifications we can notify the user when this happens.
This could be an optional feature such as if you
composer require mercure
in your project the feature gets activated and users start receiving real time push notifications when the page they are looking at, whether it is an editing or an index page, is not up to date any moreYou can setup a demo of the feature here : https://github.com/coopTilleuls/easyadmin-mercure-demo