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

User-defined columns in CamelCase stop realtime from sending updates #306

Closed
NiklasPor opened this issue Oct 18, 2022 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@NiklasPor
Copy link

NiklasPor commented Oct 18, 2022

Bug report

User-defined columns in CamelCase stop realtime from sending updates to the client.

Describe the bug

When a table contains a user-defined field with CamelCase naming, realtime stops sending updates for the table.

To Reproduce

CREATE TYPE "public"."ProjectStatus" AS ENUM (
    'Available',
    'Archived',
    'Deleted'
);

CREATE TABLE "public"."Project" (
    "id" "uuid" DEFAULT "extensions"."uuid_generate_v4"() NOT NULL,
    "name" character varying NOT NULL,
    "status" "public"."ProjectStatus" DEFAULT 'Available'::"public"."ProjectStatus" NOT NULL
);
  supabase
    .channel('*')
    .on('postgres_changes', { event: '*', schema: '*' }, (payload) => console.log(payload))
    .subscribe();

Result:

  • Logs don't show anything
  • WebSocket inspector is also not showing anything

Workaround

Renaming the types to snake_case fixes the problem and supabase sends updates again:

ALTER TYPE public."EntityStatus" RENAME TO entity_status;

System information

  • OS: macOS
  • Supabase CLI: 1.8.7 (bug is not occuring there, only on remote)
  • supabase-js: 2.0.0

Additional context

As stated at the beginning, a very similar / same bug already appeared in the past: #211

@NiklasPor NiklasPor added the bug Something isn't working label Oct 18, 2022
@w3b6x9
Copy link
Member

w3b6x9 commented Oct 19, 2022

@NiklasPor thanks for creating this bug report! i'll investigate this shortly.

@w3b6x9
Copy link
Member

w3b6x9 commented Oct 19, 2022

@NiklasPor i was able to reproduce. i'll pass this on to the rest of the realtime team and we'll address this. thanks again!

@w3b6x9 w3b6x9 transferred this issue from supabase/realtime Oct 19, 2022
@w3b6x9
Copy link
Member

w3b6x9 commented Oct 19, 2022

Note: doesn't work when there's any uppercase letter in the type name.

@w3b6x9
Copy link
Member

w3b6x9 commented Oct 21, 2022

@NiklasPor we have just deployed a fix so this shouldn't be an issue anymore.

@w3b6x9 w3b6x9 closed this as completed Oct 21, 2022
@NiklasPor
Copy link
Author

Wow, thanks a lot!

w3b6x9 pushed a commit that referenced this issue Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants