tasking-manager icon indicating copy to clipboard operation
tasking-manager copied to clipboard

Preventing the tagging of non-existent users.

Open vegeta999 opened this issue 4 years ago • 2 comments

This PR prevents the tagging of non-existent users, changes made:

  1. Everytime method get_message is called, it parses the usernames tagged, checks whether they exist and sends a list of validated usernames to frontend along with message.
  2. Frontend while link-ifying the username checks whether this username is present in validated list.

I thought of a bit optimized approach in which we store the tagged usernames in db for every message, and just iterate over usernames(rather than whole message) to check existence on every GET. Also I felt checking user's existence for every GET is necessary because the user might not be existing while comment was created but exists now !

@ramyaragupathy @willemarcel please review !

vegeta999 avatar Mar 19 '20 13:03 vegeta999

Closes #2498

vegeta999 avatar Mar 19 '20 18:03 vegeta999

Hey, thanks for this! Tested this and behaviour is fine.

I agree that we somehow have to cover the edge case of people linking to users that appear later on. However I do think this is the edge case, and doing this check on each get_message seems to be quite complex and i fear this has negative effects on the performance.

I'm wondering whether it would make sense to do the following:

  • When saving a comment check if a @[...] to a non-existing user is inside the text. If this is the case set a flag on the db for this message.
  • Only run the check within get_message on the ones that have this flag set, but not on all.

@ramyaragupathy, @willemarcel what do you think is a good solution for this problem?

we can only do the check, if the message contains a not existing user

pantierra avatar Mar 25 '20 14:03 pantierra

stale, but bumped the priority on issue cc @royallsilwallz @manjitapandey

ramyaragupathy avatar May 01 '24 04:05 ramyaragupathy