Open lauri865 opened 1 week ago
We removed those additional payloads, and everything seems to be working fine at initial look:
message.event === "access_token"
(gets rid of 1 extra message per each page view)We did it on a custom transport level for now.
Bug report
Describe the bug
Each setAuth call sends a new access_token payload (all good): https://github.com/supabase/realtime-js/blob/82e996685da8ecb75f327d7faf52096b5953c3c3/src/RealtimeClient.ts#L337-L347
Each sendHeartBeat call calls setAuth (even if accessToken hasn't changeD), which results in a lot of unnecessary messages being sent: https://github.com/supabase/realtime-js/blob/82e996685da8ecb75f327d7faf52096b5953c3c3/src/RealtimeClient.ts#L553-L574
Also, each call to join a channel triggers new call to access_token, even though the accessToken is also sent with the
phx_join
event already.Are we being charged for all these unnecessary messages being sent?