כשמשנים שם משתמש, הוא צריך לעדכן אזכורים בפוסטים של המשתמש עצמו

סיכום מבוסס בינה מלאכותית

A bug was reported where changing a user’s username (e.g., from @userA to @userB) does not update @mentions of that username in the user’s own posts, though it correctly updates mentions in other users’ posts. This also affects anonymized users, whose self-mentions still display the original username. bloomexperiment documented the issue with reproduction steps and noted its prevalence in forums where users tag themselves (e.g., “you can tag @bloomexperiment”). JammyDodger confirmed the behavior with a screenshot. zogstrip acknowledged the report as an overlooked edge case and committed to fixing it. The issue was later resolved by selase, who linked to the merged fix in the Discourse GitHub repository (PR #20071). bloomexperiment expressed gratitude to the team and community for helping surface and resolve the issue.

Description

Context

When you change the username of a user (e.g. userA to userB), it updates all the @mentions of their username to avoid broken mentions.

@userA → @userB

Problem

However, it doesn’t seem to update the mentions in the user’s own posts. If userA has a post containing @userA, it doesn’t change that to @userB when their username is changed.

It does update the mentions correctly in other users’ posts.

This also applies when they have been anonymised — the @mentions in their own posts display their original username, while mentions in others’ posts have the new anonymised username.

Steps to Reproduce

  1. Have a user make posts mentioning their own username
  2. Change their username or anonymise the user

Expected

@mentions of their username are updated in their own posts, to reflect the new username

Actual

@mentions of their username are not updated in their own posts, and stay as the old username

Extra comments

It’s relatively common enough for users in our forum to refer to themselves in third person (e.g. “you can tag @traceymoko if you have questions”)

You can see other examples here:

https://forum.gethopscotch.com/t/tagging-yourself-it-does-not-update-what-the-goigly/65317

I’m not sure if the @mentions are registered only when other people make the mentions, but I suspect that might be the case. Feel free to set the category depending on whether this behaviour is intended or not — either bug or feature request.

7 לייקים

That’s an interesting one. :slight_smile:

I can confirm that I am also seeing this behaviour:

Let me see what I can find out. :+1:

6 לייקים

Thank you @traceymoko for your excellent bug report :clap:

It’s definitely an edge case we hadn’t considered and we’ll get it fixed.

6 לייקים

@traceymoko Thanks for the detailed report. This has been fixed.

https://github.com/discourse/discourse/pull/20071

6 לייקים

Thank you so much! Just wanted to say thanks to our users for posting about this too – I just collated the information.

4 לייקים

This topic was automatically closed after 3 days. New replies are no longer allowed.