realtime-csharp icon indicating copy to clipboard operation
realtime-csharp copied to clipboard

Realtime not working in .Net with custom Schema that includes dotnotation

Open jkears opened this issue 10 months ago • 5 comments

Bug report

I do not see any events to tables in schema "NextWare.Concierge.ConciergeServices". If I rename to "NextWare_Concierge_ConciergeServices" it seems to fire events from within the publication.

Describe the bug

It seems as if Supabase in general struggles with Schema names that include '.' but these are valid schema names.

To Reproduce

Create a schema that includes '.' separators

Expected behavior

That is works, but it does not.

jkears avatar Apr 22 '24 17:04 jkears

Very interesting! Provided your configuration is all correct (as outlined here: https://supabase.com/docs/guides/realtime/postgres-changes) and the events don't show in your supabase console either, this would be an upstream bug that would need to be tracked in the supabase/realtime repo!

acupofjose avatar Apr 22 '24 19:04 acupofjose

Is there another way to implement CDC without relying on your realtime publications?


From: Joseph Schultz @.> Sent: April 22, 2024 15:49 To: supabase-community/realtime-csharp @.> Cc: John Kears @.>; Author @.> Subject: Re: [supabase-community/realtime-csharp] Realtime not working in .Net with custom Schema that includes dotnotation (Issue #46)

Very interesting! Provided your configuration is all correct (as outlined here: https://supabase.com/docs/guides/realtime/postgres-changes) and the events don't show in your supabase console either, this would be an upstream bug that would need to be tracked in the supabase/realtime repo!

— Reply to this email directly, view it on GitHubhttps://github.com/supabase-community/realtime-csharp/issues/46#issuecomment-2070824328, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJ3FOOAWQI6PPXG7UNNMDLY6VSUHAVCNFSM6AAAAABGTFLANCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZQHAZDIMZSHA. You are receiving this because you authored the thread.Message ID: @.***>

jkears avatar Apr 22 '24 19:04 jkears

Also the documentation you linked to me is for JS. I am using C# from a backing domain service, thus more like a trusted Client-Credential type integration.


From: John Kears @.> Sent: April 22, 2024 15:55 To: supabase-community/realtime-csharp @.>; supabase-community/realtime-csharp @.> Cc: Author @.> Subject: Re: [supabase-community/realtime-csharp] Realtime not working in .Net with custom Schema that includes dotnotation (Issue #46)

Is there another way to implement CDC without relying on your realtime publications?


From: Joseph Schultz @.> Sent: April 22, 2024 15:49 To: supabase-community/realtime-csharp @.> Cc: John Kears @.>; Author @.> Subject: Re: [supabase-community/realtime-csharp] Realtime not working in .Net with custom Schema that includes dotnotation (Issue #46)

Very interesting! Provided your configuration is all correct (as outlined here: https://supabase.com/docs/guides/realtime/postgres-changes) and the events don't show in your supabase console either, this would be an upstream bug that would need to be tracked in the supabase/realtime repo!

— Reply to this email directly, view it on GitHubhttps://github.com/supabase-community/realtime-csharp/issues/46#issuecomment-2070824328, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJ3FOOAWQI6PPXG7UNNMDLY6VSUHAVCNFSM6AAAAABGTFLANCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZQHAZDIMZSHA. You are receiving this because you authored the thread.Message ID: @.***>

jkears avatar Apr 22 '24 20:04 jkears

This is very broken, I just applied the steps (as outlined here: https://supabase.com/docs/guides/realtime/postgres-changes) and now I am not getting any notifications

Please let me know if there is a way to implement CDC using the Outbox Pattern. I thought the SupaBase realtime publications were going to be easy and just work. I was wrong.


From: John Kears @.> Sent: April 22, 2024 15:59 To: supabase-community/realtime-csharp @.>; supabase-community/realtime-csharp @.> Cc: Author @.> Subject: Re: [supabase-community/realtime-csharp] Realtime not working in .Net with custom Schema that includes dotnotation (Issue #46)

Also the documentation you linked to me is for JS. I am using C# from a backing domain service, thus more like a trusted Client-Credential type integration.


From: John Kears @.> Sent: April 22, 2024 15:55 To: supabase-community/realtime-csharp @.>; supabase-community/realtime-csharp @.> Cc: Author @.> Subject: Re: [supabase-community/realtime-csharp] Realtime not working in .Net with custom Schema that includes dotnotation (Issue #46)

Is there another way to implement CDC without relying on your realtime publications?


From: Joseph Schultz @.> Sent: April 22, 2024 15:49 To: supabase-community/realtime-csharp @.> Cc: John Kears @.>; Author @.> Subject: Re: [supabase-community/realtime-csharp] Realtime not working in .Net with custom Schema that includes dotnotation (Issue #46)

Very interesting! Provided your configuration is all correct (as outlined here: https://supabase.com/docs/guides/realtime/postgres-changes) and the events don't show in your supabase console either, this would be an upstream bug that would need to be tracked in the supabase/realtime repo!

— Reply to this email directly, view it on GitHubhttps://github.com/supabase-community/realtime-csharp/issues/46#issuecomment-2070824328, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAJ3FOOAWQI6PPXG7UNNMDLY6VSUHAVCNFSM6AAAAABGTFLANCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZQHAZDIMZSHA. You are receiving this because you authored the thread.Message ID: @.***>

jkears avatar Apr 22 '24 20:04 jkears

I can confirm that the dot notation does fail to be published/replicated from the supabase editor.

For example:

Given the following:

DROP SCHEMA "parent.child.cousin" CASCADE;
CREATE SCHEMA "parent.child.cousin";

SET search_path TO "parent.child.cousin";

CREATE TABLE outbox (
    MessageId SERIAL PRIMARY KEY,
    MessageBody TEXT NOT NULL,
    Recipient VARCHAR(255) NOT NULL,
    Status VARCHAR(50) NOT NULL,
    RetryCount INTEGER NOT NULL DEFAULT 0,
    NextRetryTimestamp TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
    CreatedTimestamp TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
    LastUpdatedTimestamp TIMESTAMP WITH TIME ZONE
);

The dashboard produces the error when enabling publications:

Failed to update database publication: failed to update pg.publications with the given ID: relation "parent.child.cousin.outbox" does not exist

However, the following does work:

DROP SCHEMA "parent_child_cousin" CASCADE;
CREATE SCHEMA "parent_child_cousin";

SET search_path TO "parent_child_cousin";

CREATE TABLE outbox (
    MessageId SERIAL PRIMARY KEY,
    MessageBody TEXT NOT NULL,
    Recipient VARCHAR(255) NOT NULL,
    Status VARCHAR(50) NOT NULL,
    RetryCount INTEGER NOT NULL DEFAULT 0,
    NextRetryTimestamp TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
    CreatedTimestamp TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
    LastUpdatedTimestamp TIMESTAMP WITH TIME ZONE
);

This is not a limitation of the library though, it's a limitation from supabase. If it's something that you'd like addressed, please open an issue on the supabase/realtime repo.

acupofjose avatar Apr 23 '24 02:04 acupofjose