V3L0C1T13S / reflectcord

REST and Websocket compatibility layer for Discord->Revolt
GNU Affero General Public License v3.0
45 stars 2 forks source link

Rework Gateway #201

Open V3L0C1T13S opened 1 year ago

V3L0C1T13S commented 1 year ago

Currently, Reflectcord's Gateway consists of mostly the same structure as Spacebar's Gateway, but this has proved to be cumbersome to work with, given the infrastructure differences between Reflectcord and Spacebar. While Spacebar has to do (mostly) nothing other than filter out events and dispatch them, and respond appropriately to updates, such as membership changes, we have to worry about translation, caching data from Revolt so that we don't have to re-request information, which risks rate limits, and we have to do all of this per connection.

This issue proposes a new design that would, at the very least, share some data for the same users between connections, and also remove the giant monolithic, near 2000 line Listener.ts that handles Revolt events, and translating them to Discord ones.