cli icon indicating copy to clipboard operation
cli copied to clipboard

After v0.24.6, connecting to realtime fails

Open aboodman opened this issue 3 years ago • 6 comments

Prior to 0.24.6, this code in my repo works:

      const supabase = createClient(
        process.env.NEXT_PUBLIC_SUPABASE_URL!,
        process.env.NEXT_PUBLIC_SUPABASE_KEY!
      );
      supabase
        .from(`space:id=eq.${spaceID}`)
        .on("*", () => {
          r.pull();
        })
        .subscribe();

After 0.24.6, the web socket connection fails and I get the following error:

Screen Shot 2022-04-21 at 4 10 15 PM

Here is my schema setup if it is useful:

  await executor(`create table space (
      id text primary key not null,
      version integer not null,
      lastmodified timestamp(6) not null
      )`);

  await executor(`alter publication supabase_realtime add table space`);
  await executor(`alter publication supabase_realtime set 
      (publish = 'insert, update, delete');`);

aboodman avatar Apr 22 '22 02:04 aboodman

@aboodman which version were you on prior to v0.24.6?

@soedirgo can you please help investigate?

w3b6x9 avatar Apr 22 '22 02:04 w3b6x9

I verified that it actually works with the commit directly prior by building cli from source. It's definitely commit 7d1ff1158d35c9262717f0201e717ad4945bc48e that breaks my project.

aboodman avatar Apr 22 '22 02:04 aboodman

Also you can actually try my project easily and see the failure. The setup here and is really simple:

https://github.com/rocicorp/replicache-todo/blob/main/README.md

If you run this against current head supabase, it will fail. You'll get an error over the socket connection to supabase like I describe in first comment. If you run it against 0.24.5 or earlier, it works.

HTH

aboodman avatar Apr 22 '22 06:04 aboodman

Should be fixed now in v0.24.9. Can you try again?

soedirgo avatar Apr 22 '22 07:04 soedirgo

I can confirm this works after I restarted my local Supabase instance.

johnnypea avatar Apr 22 '22 10:04 johnnypea

@soedirgo thanks!

w3b6x9 avatar Apr 22 '22 14:04 w3b6x9