Skip to content

Presence track function , unclear response. #289

Open
@kyeshmz

Description

@kyeshmz

Improve documentation

Link

Add a link to the page which needs improvement (if relevant)
https://supabase.com/docs/guides/realtime/presence

Describe the problem

Presence track function returns a response, but this is not the case all the time.
Does presence need some kind of ack config?

Is the documentation missing? Or is it confusing? Why is it confusing?

Describe the improvement

A clear and concise description of the improvement.

The typescript shows how it is waiting for some "ok" or "error", but it is unclear how the subscribers should return this.

It is also kind of confusing how you can also use "send" rather than "track" for sending through presence.

Additional context

I am using valtio state manager to create my channel, which has both broadcast and presence subscriptions.

const tmpGuessChannel = supabaseClient
      .channel("game_channel", {
        config: {
          broadcast: { self: true },
        },
      })
realtimeState.realtimeChannel = ref(tmpGuessChannel)

In another function I call

 const test = await realtimeState.realtimeChannel!.track({
    state: state,
  });

This test is never consoled out and this await never resolves, making it necessary to avoid await for this function.

Add any other context or screenshots that help clarify your question.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions