Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Real-time push notifications with mercure when entities are modified by someone else #5765

Open
slim opened this issue May 25, 2023 · 1 comment

Comments

@slim
Copy link

slim commented May 25, 2023

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 more

You can setup a demo of the feature here : https://github.com/coopTilleuls/easyadmin-mercure-demo

Capture d’écran de 2023-05-25 08-54-14

Capture d’écran de 2023-05-25 15-54-44

@slim slim changed the title Real-time push Notification when the Entity I am editing has changed on server Real-time push notifications with mercure when entities are modified by someone else May 25, 2023
@slim slim changed the title Real-time push notifications with mercure when entities are modified by someone else [RFC] Real-time push notifications with mercure when entities are modified by someone else May 25, 2023
@dunglas
Copy link

dunglas commented May 25, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants