bytemunch / bevy-supabase

Supabase + Bevy
Apache License 2.0
4 stars 1 forks source link

Using realtime features #1

Closed richchurcher closed 3 weeks ago

richchurcher commented 1 month ago

Hi, me again! Just been reading through things, and I'd love to help/use this library but I have a few initial questions. Mostly, I only need the realtime portion of this. I wonder if it would be worth exporting more types from bevy_realtime, to facilitate folks who just need to react to Postgres changes? Alternatively, do you have a quick example (even rough) of using bevy_supabase to listen to table changes? I see it adds a RealtimePlugin, but I'm thinking maybe the API to talk to that might not be "cooked" yet?

Don't worry, not expecting miracles or lots of free work! But if I can maybe get a start, I could kick in with PRs as I work on my Bevy stuff :sunglasses:

richchurcher commented 1 month ago

In the meantime I'm just gonna straight rip the bevy-realtime crate and see if I can understand it.

richchurcher commented 1 month ago

Interesting. Yeah, so trying bevy-realtime, it seems to block on https://github.com/bytemunch/bevy-supabase/blob/main/crates/bevy-realtime/src/lib.rs#L59 and never either return a channel or an error. I imagine this is the sync/async struggle again, but sadly I wasn't up to the challenge of debugging it! Hopefully I can help out more once I'm a bit more familiar :pray:

bytemunch commented 1 month ago

Yeah you're right that none of it's cooked yet! 😅 I'm working on making an authed todo app in bevy that should hit all code paths, I'm just a bit busy and slow at the moment 😬 hope to be free on the back half of next week, will push on 🤙

PRs welcome once you get a handle on the codebase ✌️

On Sat, 11 May 2024, 06:58 Rich Churcher, @.***> wrote:

Interesting. Yeah, so trying bevy-realtime, it seems to block on https://github.com/bytemunch/bevy-supabase/blob/main/crates/bevy-realtime/src/lib.rs#L59 and never either return a channel or an error. I imagine this is the sync/async struggle again, but sadly I wasn't up to the challenge of debugging it! Hopefully I can help out more once I'm a bit more familiar 🙏

— Reply to this email directly, view it on GitHub https://github.com/bytemunch/bevy-supabase/issues/1#issuecomment-2105580919, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKMCYI3AUNORTIEKZPKOWW3ZBWXR3AVCNFSM6AAAAABHONVOOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBVGU4DAOJRHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

richchurcher commented 1 month ago

I completely get the time struggle! I'll see if I can divine anything further with my scary mixed-up codebase. I was interested to see that including the BuildChannel component was enough to completely stop the game window from rendering... just a black screen. Don't know how I managed that one 😅

bytemunch commented 1 month ago

I've been tinkering and I think I've cracked the issue, a tokio version mismatch between bevy-realtime and realtime-rs. I'd expect that there would be some feedback from the compiler but apparently it just silently fails. Doing a clean recompile and testing but think that it'll be back to working again with commit fc32e60.

The examples at crates/bevy-realtime/examples are working for me again, let me know if the update makes any difference

richchurcher commented 1 month ago

Awesome! I'll check this today hopefully.

richchurcher commented 1 month ago

Heh. Yeah, sadly after updating my local versions, I'm still getting a black screen lockup. This may entirely be user error, I note with haste! However the tokio dependency does seem to be a bit of a stumbling block, so if it's OK with you I'm curious what an implementation in "native Bevy" might look like, will investigate.

richchurcher commented 3 weeks ago

Closing (nokio branch works).