-
Notifications
You must be signed in to change notification settings - Fork 12
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
Can't retrieve data through RealtimeChannel.OnUpdate #22
Comments
|
@Shenrak such a thorough issue! I love when so much data is provided. I think this is a regression from updating the Newtonsoft.Json dependency - I'll get it pushed out in an update this evening! Thanks so much for digging into it! |
Available in [email protected] / [email protected]! |
Have you tried using var m = a.Response.OldModel<SchemaMaintenance>(); |
And to be clear... you're having |
I'm using OnUpdate only with updates, i'v not try it with Inserts and Deletes void OnChannelUpdate(object sender, PostgresChangesEventArgs a)
{
var oldModel = a.Response.OldModel<SupabaseModel>();
var model = a.Response.Model<SupabaseModel>();
if (JsonConvert.SerializeObject(oldModel) != JsonConvert.SerializeObject(model))
{
OnRemotelyUpdated?.Invoke(model);
}
} Pretty much what I'm trying to do is to call The issue here is that OldModel is missing some data, as i linked in my preview message |
Gotcha! If you want to receive the "previous" data for updates and deletes, you will need to set As for the updates with no changed data being sent - you are calling with an insert, even if there isn't actually a change. So the client is working as expected - you'll need to do the filtering on your side. |
Yup, that's pretty much what I ended up doing, also i don't update the DB if there's been no change anymore |
Bug report
Describe the bug
RealtimeChannel's response isn't parsed correctly.
Both
RealtimeChannel.Model<T>()
andPostgresChangesEventArgs.Response.Payload.Data.Record.Record
are defaults values.To Reproduce
Subscribe to a table with RealtimeChannel.OnUpdate
Expected behavior
Getting correct data that's been updated
Screenshots
Table
maintenance
The following screenshot showcases what's happening in RealtimeChannel.Model()
The raw content of
Json
:System information
Additional context
I'd like to add that it was not clear to me as what to put in
database
field of Channel() :As my table was in the
postgres
database, i had a though time to figure it out :pGuillaume
The text was updated successfully, but these errors were encountered: