Skip to content

realtime only emitting DELETE events (but not INSERT or UPDATE) #335

@tconroy

Description

@tconroy

Bug report

realtime only emitting DELETE events (no INSERT or UPDATE)

Describe the bug

When I perform an INSERT or UPDATE to a table with realtime + RLS enabled, I do not receive any realtime event:

supabase
    .from('*')
    .on('*', (payload) => {
      console.log(`${payload.eventType} received: `, payload);
    })
    .subscribe();

DELETE events are correctly received.

The user has appropriate RLS permissions, because all data correctly loads on the client via supabase cllient REST calls.

To Reproduce

Unfortunately not able to share an example because it would be difficult to decouple the issue I'm seeing from domain-specific app code. However, here is my configuration:

1. replication enabled:
Screen Capture 2021-12-26 at 11 47 45@2x

2. replication enabled on tables:
Screen Capture 2021-12-26 at 11 48 29@2x

3. Subscription configuration:

supabase
    .from('*')
    .on('*', (payload) => {
      console.log(`${payload.eventType} received: `, payload);
    })
    .subscribe();

Expected behavior

When I perform an INSERT or UPDATE on entities (such as board_lists table or board_cards table), I expect to see the following logged:

INSERT received: {payload data}

However, I do not see any realtime event except for DELETE operations, which are behaving as expected.

I am able to correctly perform INSERT, UPDATE and READ events on the client via the Supabase client/REST API, so I know that the RLS policies are not preventing the user from performing these operations.

System / versions

  • MacOS latest
  • Node @ v17.2.0
  • Yarn @ 1.22.17
  • @supabase/supabase-js@1.29.0
  • @supabase/realtime-js@^1.3.3
  • @supabase/gotrue-js@^1.21.7
  • @supabase/postgrest-js@^0.35.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions