Open jvlt opened 1 year ago
Thanks @jvlt for opening this issue. Yup, that behavior is buggy. I will fix it right now!
Just to break down the issue, this is an issue on the SDK side, and can be fixed with the PR above.
Lets say there are 2 rows where col is true. These two are delivered to the device and an event is registered everytime something changes in these rows. So far so good. But: If a different row gets col set to true, the SDK throws the following error: Unhandled Exception: Exception: Could not find the updated record. The expected behavior would be for the SDK to deliver 3 rows.
This on the other hand is happening due to the current limitation on our realtime server. I have opened an issue here, so let's see if there is a way to work around it.
Furthermore, if a row A that previously had col = true gets set to col = false, there is no event emitted. Additionally, if something changes in a row where col is still set to true, the row A will still be emitted in the event, but in the state before col was set to false.
Thanks @dshukertjr! Is there something that can be done in the SDK regarding the fact that a row not matching the equality condition is still included in the data set?
Since I am creating graphics for something else, I may as well just put them here too:
Current behavior:
Desired behavior:
Where A and B are rows and Result is the stream provided by the SDK.
@jvlt
Is there something that can be done in the SDK regarding the fact that a row not matching the equality condition is still included in the data set?
There probably isn't anything we can do on the client side. Because the server does not emit the fact that the row went from true
to false
, there is no way for the client to know that and stop emitting it as a stream.
if a row A that previously had col = true gets set to col = false, there is no event emitted
@jvlt what did you end up doing to track this?
I do have same problem when using stream with .eq though as mine is reading inside to a json data
base.from("monitoring_sheet")
.stream(primaryKey: ["id"])
.eq("some_id->>my_id","36sth26537")
it wont stream whenever i change in the db it won't listen is there a way to fix this?
@Erchil66 That seems like a separate issue. Would you be able to open a separate issue for it?
Sure, @dshukertjr
Describe the bug Maybe I am missing something, but there seems to be a bug when using the .eq filter in streaming data via realtime.
To Reproduce Steps to reproduce the behavior:
col
)supabase.from('example').stream(primaryKey: ['id']).eq('col', true);
Expected behavior Lets say there are 2 rows where
col
is true. These two are delivered to the device and an event is registered everytime something changes in these rows. So far so good. But: If a different row getscol
set to true, the SDK throws the following error:Unhandled Exception: Exception: Could not find the updated record.
The expected behavior would be for the SDK to deliver 3 rows.Furthermore, if a row A that previously had
col = true
gets set tocol = false
, there is no event emitted. Additionally, if something changes in a row where col is still set to true, the row A will still be emitted in the event, but in the state before col was set to false.Smartphone (please complete the following information): Version:
supabase_flutter: ^1.2.1
Additional context Complete error message: