Fix losing wiki comments on some wiki page slug changes
What does this MR do and why?
In the course of fixing a race condition on creating wiki pages, we detect duplicate WikiPage::Meta records with the same slug and remove the newer record.
This turned out to be a bad strategy, because we found out that deleting wiki pages doesn't clean up their WikiPage::Meta record. Now, this conflict can happen when moving a page to a slug that was occupied by some other deleted page, and this can result in losing comments (notes) associated with this WikiPage::Meta record if the record is newer.
To fix this, this MR removes the creation date constraint, ensuring only the orphaned record is removed.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Create a wiki page with slug
fooand add a comment. - Create another wiki page with slug
barand add a different comment. - Delete page
foo. - Edit page
barand change slug tofoo. - The comments from
barshould still be there. - Repeat from 1, but delete page
barinstead, and change slug infootobar.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.