Fix wiki comments user mentions and todos
What does this MR do and why?
This fixes:
-
User mentions for wiki page comments erroring out due to the user mention records not including the sharding key namespace_id.
Mentions are UPSERTed directly in the db and the model validations are skipped, so instead of a model validation, this is now done with a database trigger.
-
Todos not appearing in the todo lists for users. This is a direct consequence of allowing user mentions and wiki pages have to implement the
Todoable
interface in both the model and the GraphQL type for the todos to work correctly.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Enable
wiki_comments
feature flag. - Go to/create a new wiki page.
- Comment on the page, mentioning yourself or other users.
- See the todo on the To-Do List of a mentioned user.