Refactor use of ensureStructure to reduce locking #295
Labels
No labels
Component: User interface
Component: Wymeditor
Help wanted
Level: Difficult
Level: Easy
Level: Moderate
Pagetype: Festival
Pagetype: Mailinglist
Pagetype: Peer reviewed article
Pagetype: Text
Privacy GDPR AVG
status: has conflicts
Status: Needs changes
Status: Needs discussion
Status: Needs review
Status: Ready to merge
Status: Waiting for response
Type: Bug
Type: Enhancement
Type: Question
Usecase: De Stadsbron
Usecase: Koppelting
Usecase: MeetjeStad
Value: Coders
Value: Security
Value: Users
Value: Visitors
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
harmen/hypha#295
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, the mailinglist and article datatypes use an
ensureStructure()method that creates any missing structure if needed. It is called on every request, which seems a bit much.In practice, there might be two problems:
NEWLY_CREATED, but it does not recheck the status after taking the lock. If two requests happen concurrently, both might end up adding structure, resulting in duplicate elements. This is rather unlikely, since the first request after creating a page (by the page creator) will usually create the structure anyway.I think it might be better to have a scheme where the datatype is involved in creating the page, so the initial content can be added as part of the page creation and happen just once.