mattermost / mattermost-plugin-msteams

MS Teams plugin for Mattermost
Other
13 stars 11 forks source link

Fix username dedup for synthetic users #553

Closed JulienTant closed 5 months ago

JulienTant commented 6 months ago

Summary

When creating a new synthetic user, the synthetic user is being given a username of msteams_[username]. If this is not available, we want to suffix this with -{idx}. The current code would add -{idx} at the end of each iteration, leading to the username looking like msteams_[username]-1-2-3-4 instead of msteams_[username]-4.

This PR fixes this issue.

Ticket Link

N/A

JulienTant commented 6 months ago

@enahum I don't mind dealing with the conflict if you wanna merge your branch first! I don't think this is super urgent: we would need at least three users with the exact same username for this to happen, and this is not anything that would put the plugin in a broken state.