spacebarchat / spacebarchat/server

insertChannelInOrder fails on enabling community mode

Open
#1,226 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.2k
Forks
323
Avg merge
14h 48m
Merged PRs (30d)
4

Description

[Error] 400 /api/v9/guilds/1295695667913564212
 TypeError: Cannot read properties of undefined (reading 'remove')
    at Guild.insertChannelInOrder (/home/Rory/git/spacebar/server/dist/util/entities/Guild.js:211:32)
    at /home/Rory/git/spacebar/server/dist/api/routes/guilds/#guild_id/index.js:125:28 
body: [Object: null prototype] {
  features: [ 'COMMUNITY' ],
  verification_level: 1,
  default_message_notifications: 1,
  explicit_content_filter: 2,
  rules_channel_id: '1',
  public_updates_channel_id: '1'
}

guild.ts:445:
guild.channel_ordering.remove(channel_id);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at guild.ts:445 and the Guild.insertChannelInOrder call from the guild update route shown in the stack trace. Reproduce enabling community mode with rules_channel_id and public_updates_channel_id set to '1', then trace why channel_ordering.remove receives an undefined value. Done means the request no longer throws the TypeError and channel ordering remains valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.