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

Should we add Version property to ContentItem class to get optimistic lock work properly? #15729

Open
aaronamm opened this issue Apr 11, 2024 · 8 comments

Comments

@aaronamm
Copy link
Contributor

Is your feature request related to a problem? Please describe.

So right now OC checks optimistic lock when saving a content item.
However, we can't manually set version value to a content item.
Therefore, we can't do optimistic lock over content item object.

Describe the solution you'd like

I think we should add public long Version to ContentItem.cs.
This allow us to set Version's value from form's input when saving a content item and prevent multiple users trying to update a content item at the same time.

FYI, I started this topic as discuss and found it should be a new PR but I want to get idea/feedback before implementing it.
Please check.
#15721

@aaronamm
Copy link
Contributor Author

CC @sebastienros @Skrypt

@hishamco
Copy link
Member

AFAIK the content lock is a missing feature

@aaronamm
Copy link
Contributor Author

@hishamco if I understand it correctly, YesSQL supports this feature.
However our ContentItem class does not have Version property to get optimistic lock work property.
We can make a very simple PR to fix this but I only want to make sure if there is other ideas/suggestions on the issue.

@aaronamm
Copy link
Contributor Author

@hishamco please also check this link. #15721

@hishamco
Copy link
Member

We can make a very simple PR to fix this but I only want to make sure if there is other ideas/suggestions on the issue.

AFAIK Seb mentioned content lock long time a ago, we can use SignalR, so once the user starts to edit a content item it should trigger anyone else opening the same page to lock the content temporarily, so once he saves or cancels the update process, others can start editing

@aaronamm
Copy link
Contributor Author

@hishamco I got your idea. However, for a simple application that does not allow two administrators to override the same content, using optimistic lock is a good option.
IMHO, I don't think we need SignalR for a simple app, even though it is easy to add to an application.

@hishamco
Copy link
Member

You could propose a PR

@aaronamm
Copy link
Contributor Author

@hishamco thank you for your suggestion.

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

No branches or pull requests

2 participants