Skip to content

valid Op 37 closes Gateway with an error #1568

@s074

Description

@s074

Describe the bug
A valid OP 37 Gateway message from a Discord clients results in Gateway Disconnecting with an error

Message:

{"op":37,"d":{"subscriptions":{"1471674209200554039":{"typing":true,"activities":true,"threads":true}}}}

Error:

Error: Op 37 Error: Must provide channel ranges
    at WebSocket.onLazyRequest (/home/user/spacebar-server/src/gateway/opcodes/LazyRequest.ts:215:26)
    at WebSocket.onGuildSubscriptionsBulk (/home/user/spacebar-server/src/gateway/opcodes/GuildSubscriptionsBulk.ts:14:29)
    at WebSocket.Message (/home/user/spacebar-server/src/gateway/events/Message.ts:96:36)
    at WebSocket.emit (node:events:518:28)
    at Receiver.receiverOnMessage (/home/user/spacebar-server/node_modules/ws/lib/websocket.js:1225:20)
    at Receiver.emit (node:events:518:28)
    at Receiver.dataMessage (/home/user/spacebar-server/node_modules/ws/lib/receiver.js:596:14)
    at Receiver.getData (/home/user/spacebar-server/node_modules/ws/lib/receiver.js:496:10)
    at Receiver.startLoop (/home/user/spacebar-server/node_modules/ws/lib/receiver.js:167:16)
    at Receiver._write (/home/user/spacebar-server/node_modules/ws/lib/receiver.js:94:10)

To Reproduce
Steps to reproduce the behavior:

  1. Load spacebar on a discord client
  2. Click on a channel
  3. Gateway errors out

Expected behavior
Message should be accepted

System Information (please complete the following information):

  • Spacebar version: latest master (HEAD ab4a8a3)
  • Discord client version: latest stable client (stable 503231 (b04be92) Build Override: N/A)

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