Skip to content

Eech heartbeat and channel join sends a new accessToken, even if token hasn't changed, same for channel join #1724

@lauri865

Description

@lauri865

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrealtime-jsRelated to the realtime-js library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions