Closed TomTom101 closed 1 year ago
Just saw this "Streamed responses (used by the realtime service) are not supported on the web". I guess this answers my questions, realtime is not supported on the web plattform. What a bugger. Anyhow, lovely project, this!
@TomTom101 Yes, that's correct. Currently the Dart SDK realtime service doesn't work on the web platform. There are workarounds, eg. using the browser EventSource js-interop and/or use fetch
to send the request, but it would be better and more maintainable in the long run if it is added in the dart http client (you can subscribe to this issue - https://github.com/dart-lang/http/issues/595).
I'll close the issue for now as it is known limitation, but if someone else think that it is worth investing the time creating a workaround, please let me know and depending on the users demand I may reconsider implementing it.
Thanks Gani! I am a bit spoiled with Firebase's Firestore where I simply listen to a stream and never have to worry about updating datasets anywhere. I'd sure be interested on how to replicate a similar behavior with Pocketbase, ideally in combination with Riverpod.
I would be interested in a workaround for this issue now (who knows how long Dart will take to be updated). Currently, I cannot use pocketbase because of this limitation on the web.
I cannot get realtime to work neither w/ pocketbase 0.7.10 and the Dart SDK 0.4.1 nor 0.8.0-rc2 and SDK version 0.5.0-rc2.
This is my test app for pocketbase 0.7.10 and the Dart SDK 0.4.1. I created a collection
items
and and a user with the given credentials. The pocketbase debug log shows "Realtime connection established …" but any change in theitems
collections would trigger the passed function insubscribe
.The network shows a single GET call to /api/realtime whereas a sample React app I tested, and which works fine with realtime, additionally POSTs subscriptions etc.
Can someone post a minimal Flutter with working realtime subscriptions?