Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A crash of a web IRC client (not the KiwiIRC client) caused by an issue related to RPL_TOPICWHOTIME in helpers.js #388

Open
Madriix opened this issue Dec 26, 2024 · 0 comments

Comments

@Madriix
Copy link
Contributor

Madriix commented Dec 26, 2024

Hi, Here is the error I occasionally encounter on a web IRC client running with the IRC framework:

TypeError: Cannot read properties of undefined (reading 'indexOf')
at Object.parseMask (/home/debian/node/.../server/libs/irc-framework-modded/src/helpers.js:20:23)
at Array.RPL_TOPICWHOTIME (/home/debian/node/.../server/libs/irc-framework-modded/src/commands/handlers/channel.js:198:32)
at IrcCommandHandler.executeCommand (/home/debian/node/.../server/libs/irc-framework-modded/src/commands/handler.js:65:40)
at IrcCommandHandler.dispatch (/home/debian/node/.../server/libs/irc-framework-modded/src/commands/handler.js:52:18)
at /home/debian/node/.../server/libs/irc-framework-modded/src/client.js:129:40
at next (/home/debian/node/.../server/libs/irc-framework-modded/node_modules/middleware-handler/index.js:42:18)
at MiddlewareHandler.handle (/home/debian/node/.../server/libs/irc-framework-modded/node_modules/middleware-handler/index.js:64:3)
at Connection. (/home/debian/node/.../server/libs/irc-framework-modded/src/client.js:123:35)
at Connection.emit (/home/debian/node/.../server/libs/irc-framework-modded/node_modules/eventemitter3/index.js:182:35)
at Connection.addReadBuffer (/home/debian/node/.../server/libs/irc-framework-modded/src/connection.js:167:14)

The client (server-side with the IRC framework) crashes. It doesn't happen often, on average about once a month.

About a month and a half ago, I updated to the latest version of the IRC framework. Just before that, for at least a solid year, here's how the code that causes the error was modified in helper.js. So, here's the original code:

    const sep1 = mask.indexOf('!');
    const sep2 = mask.indexOf('@');

To prevent it from crashing, I used to add this:

    //const sep1 = mask.indexOf('!');
    const sep1 = (mask || '').indexOf('!');
    //const sep2 = mask.indexOf('@');
    const sep2 = (mask || '').indexOf('@');

I've kept the original code since the last update.

I don't know how to reproduce the bug, nor how it happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant