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

Bad error when interest room prefixes are not configured but existing interest rooms are #165

Open
reivilibre opened this issue Feb 1, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@reivilibre
Copy link
Contributor

Given

    "existingInterestRooms": {
      "I.infodesk": "#infodesk:fosdem.org"
    },
    "prefixes": {
      "interestRooms": [],
...

It seems like this block of code:

        // Resolve pre-existing interest rooms
        for (const interestId in config.conference.existingInterestRooms) {
            if (interestId in this.interestRooms) {
                continue;
            }

            const roomIdOrAlias = config.conference.existingInterestRooms[interestId];
            let roomId: string;
            try {
                roomId = await this.client.resolveRoom(roomIdOrAlias);
            } catch (e) {
                // The room probably doesn't exist yet.
                continue;
            }

            this.interestRooms[interestId] = new InterestRoom(roomId, this.client, this, interestId); // <---
        }

causes an issue in the InterestRoom constructor:

this.name = decodePrefix(id, config.conference.prefixes)!.name; // <---
Wed, 01 Feb 2023 15:03:21 GMT [ERROR] [index] Fatal error TypeError: Cannot read property 'name' of null
    at new InterestRoom (/app/lib/models/InterestRoom.js:32:98)
    at Conference.construct (/app/lib/Conference.js:215:46)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async /app/lib/index.js:106:5

Maybe it's ill-defined to have the config like this but it would be nice if this was at least reported better rather than wasting time figuring it out — particularly as there's another invocation of the constructor which looks like the likely culprit but isn't.

@reivilibre reivilibre added the bug Something isn't working label Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant