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.
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.