Skip to content

Warn when mention all users in a group

Simon Knox requested to merge psi-no-all into master

What does this MR do and why?

Related #26889 (closed)

Show warning when mentioning @all in markdown fields. When we detect @all in the text field, make a request to the Preview endpoint to check how many people will be notified. If @all is removed we remove the warning.

This is meant as a sanity check against accidental @all mentions. Currently we show this in the preview tab, but if you don't click preview before posting a comment you never know!

Screenshots or screen recordings

Screen_Shot_2022-01-13_at_9.01.09_pm

How to set up and validate locally

  1. Find a group with more than 10 members (or reduce referencedUsersThreshold in field.vue)
  2. Go to an issue in that group
  3. Type @all (not in quotes) in a markdown field
  4. Realise your mistake, don't post the comment, and save thousands of notification emails

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Simon Knox

Merge request reports