Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presence track function , unclear response. #289

Open
kyeshmz opened this issue Apr 11, 2024 · 2 comments
Open

Presence track function , unclear response. #289

kyeshmz opened this issue Apr 11, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@kyeshmz
Copy link

kyeshmz commented Apr 11, 2024

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.

@kyeshmz kyeshmz added the documentation Improvements or additions to documentation label Apr 11, 2024
@w3b6x9
Copy link
Member

w3b6x9 commented Apr 11, 2024

@kyeshmz we're in the process of fixing this with PR #290. Involves a Realtime server change as well that's documented on that PR.

@kyeshmz
Copy link
Author

kyeshmz commented Apr 12, 2024

Hi @w3b6x9 I see the error handling in the PR, but is the documentation in a different PR? Is the error callback from other clients automatic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants