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

Support Object Locking to Prevent Concurrent Edit Conflicts #6654

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from

Conversation

ahmed-bhs
Copy link

Why This Feature is Useful 🚀

In apps where multiple admins or users are managing the same data, there's always the risk that one person’s changes might accidentally overwrite someone else’s work, causing data loss or inconsistencies. This is especially tricky in collaborative settings like back-office systems or content management platforms, where multiple admins are constantly editing the same records.

To solve this, I’ve added object locking to EasyAdmin. This feature makes sure that if one user is editing an object, others will be notified if it’s been modified by someone else. If there's a conflict (e.g., both users try to save changes to the same object), the second user will get a heads-up and be prompted to reload the page to get the latest version. 💡

This prevents data loss and ensures better communication, but also gives clear flash messages to users. For example, if there's a conflict, the user will see a message like this:
ksnip_20241216-190358

Benefits of This Feature 🎉

  • Prevents Data Loss: Users are notified if their changes conflict with another user’s, so accidental overwrites are minimized.
  • Improves Collaboration: When multiple admins are working on the same data, object locking ensures smoother workflows and better communication.
  • Clear User Feedback: If there's a conflict, users are clearly informed and prompted to reload the page to get the latest version.
  • Seamless Integration: The feature is super easy to implement and doesn’t mess with existing workflows. If the LockableInterface isn’t used, everything keeps working as it did before.

Why It Matters 💬

As projects grow and more users edit the same data, preventing conflicts becomes essential to keep things smooth. This feature solves a common problem and makes collaboration easier, without the stress of overwriting each other's changes. 🙌

If this sounds good for contribution, I’ll add tests and complete the translations to ensure everything runs smoothly!

Cheers

@ahmed-bhs ahmed-bhs force-pushed the feature/object-locking-prevent-concurrent-edits branch 3 times, most recently from 3913bb9 to 2766572 Compare December 16, 2024 18:35
@ahmed-bhs ahmed-bhs force-pushed the feature/object-locking-prevent-concurrent-edits branch from 2766572 to 20977ea Compare December 17, 2024 08:11
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

Successfully merging this pull request may close these issues.

1 participant