Slack handles this quite well actually. I know a lot of people dislike Slack for a lot of valid reasons, but they handle a few things right. If I type a message on Slack saying "hey, @alice, what's up?" then "@alice" gets replaced with the person's real name "Alice". When I send the message, the "Alice" bit in the resulting message becomes a link that will open the user's profile. Additionally, if "Alice" ever changes her name OR username, the name updates accordingly.
I'd argue that a username does not have the same function as a name. My name is not an identifier and most have not chosen their name - which is also why (I believe) the first name change is free of charge where I live. In most cases you can also create a different account. Depending on the type of service this might not be desirable but in others it is exactly what you would want.