Skip to content

Possible race condition with truncated nicks #74

Closed
@emersonveenstra

Description

@emersonveenstra

When a Client is given a nick that's longer than the server's allowed nick length, the server might silently truncate the nick. When RPL_WELCOME is sent, it changes the nick to the correct one.

However, if a user is using SASL, it emits the 'registered' event on either SASL failure or success, which is before RPL_WELCOME. So in the connect callback, if the user is using SASL, client.nick will still be the non-truncated nick. This is why things like matrix-org/matrix-appservice-irc#1393 are happening, the bridge assigns the value of client.nick in the connect callback and stores that for the duration of the connection.

I'm not entirely sure why it's emitting registered on SASL replies, since RPL_WELCOME will be sent no matter what.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions