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

Closed
aaronamm opened this issue Apr 11, 2024 · 11 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.

@Piedone
Copy link
Member

Piedone commented May 21, 2024

What's the use case, exactly? Two people saving a content item at the same time and overwriting each others' changes?

@Piedone Piedone added this to the 2.x milestone May 21, 2024
Copy link
Contributor

github-actions bot commented Jun 8, 2024

It seems that this issue didn't really move for quite a while despite us asking the author for further feedback. Is this something you'd like to revisit any time soon or should we close? Please reply.

@github-actions github-actions bot added the stale label Jun 8, 2024
Copy link
Contributor

Closing this issue because it didn't receive further feedback from the author for very long. If you think this is still relevant, feel free to reopen it with the requested details.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 16, 2024
@MikeAlhayek MikeAlhayek modified the milestones: 2.x, 2.0 Sep 7, 2024
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

4 participants