My understanding has been that Repeating Groups with a “Search for…” data source will update automatically as new Things get added to the database.
E.g.: Say I have an app with a shared list of Tasks. If User A has a page loaded with a RG populated w/ “Search for [all] Tasks”, and User B does some other interaction that adds a new, publicly-viewable Task to the database, the RG that User A sees will automatically update with that new Task, without having to refresh the page.
I have a few questions about this functionality.
First of all, based on many posts on this forum (e.g. Real-Time Data Issue Not Being Resolved , Realtime Updates Not Working ) it seems to have been unreliable. Is it still unreliable? I’m hoping to know what I can depend on before I put too much work into building features that depend on this type of behavior.
If it does work, are there ways to keep track of it or control it within the app? For example, I might want to animate a new item as it appears in a repeating group, or show a pop-up or toast to notify the user. Is there a way to trigger clientside workflows based on data changing?
Alternatively, I might want to disable automatic updates in particular RGs, to avoid certain race conditions. Is there any way to do this?
It is unreliable. But usually it works. It is super unreliable if user closes the laptop or switches to other app in laptop/browser. But if the page is active and open, it largely works, but not 100% reliable. Depends on what kind of application you are building. If it is a chat like application, then you may face unhappy folks.
I am not aware of any good way, except for polling on a regular basis and checking with count or latest item that you might have saved in custom state. So basically keep running a workflow every few seconds which would check if the count and latest items are same as what is in custom state or not. If same, then nothing. If different, then show toast and update custom state.
I do not know though if it will cost you extra WUs for checking the count and latest item every few seconds.
You can store the results in a list custom state and display that in the RG. Now RG will not have list updated automatically (except if the item within the list itself gets changed/deleted).
I built a real-time chat in bubble from the ground up, with notifications, no plugins.
It’s 100% reliable but that took a lot of de-bugging to achieve for me.
But I guess that’s what you’re after, people can add things to a repeating group and it shows up in real-time for other users.
And people can also create profiles that shows up in real-time in other users apps. 100% reliable. But it certainly required extensive debugging and took its time. For this function, I can’t remember of the top of my head, but I know I had to create a new profile record each time a user updates their profile. They couldn’t just update their existing one as that didn’t work.
It’s reliable during normal operations. Realtime updates do stop if the webpage is inactive after an amount of time. You can keep a page “awake” using frontend actions.
I have a queue display that relies on the feature and haven’t had issues. I keep it “awake” by incrementing a number state every 30 seconds.
Not that I have first-hand experience with it, but it seems like there is some sort of bug when backend workflows create data from reading the threads about it here on the forum. But my chats and notifications are working fine, I have not noticed the “inactive after an amount of time”, but I will test for that.
I don’t have any pointers to the documentation. Nor any video about it. Just go head and build it and you’ll learn by doing? It’s not even that complicated to build, chatGPT could probably show you how to set it up rather quickly.
It’s really not that hard to setup the shell of it once you start looking at it.
@votterskog Oh yeah totally, and with y’all’s help I’ve been able to build something that works for now. Part of my concern is that some sneaky bug might start showing up when I have more users logged in at once, or when Bubble makes some backend change, or my page gets more complex so the UI is slower and it introduces a race condition… that type of stuff. So I was hoping to see something official that describes how the feature is supposed to work, so I can know what aspects of it I can rely on vs. what things I might need to proactively manage myself.
um yeah I get you.
Any changes would suck for my paying users.
I don’t see the browser sleep issue at all, but maybe if you wait 20min or something?? Notifications are instant here.
I just tried waiting 3 minutes. But even if they close their phone and later open it, the notification is there. Never seen any issue.
I also took the load time from 20-25 sec down to 2.5 seconds when I was building it. If you have a limited amount of users, you can make a page for each user and significantly push that down.
Race conditions was something I had issues with and had to debug, but it was just to debug and see what was wrong, took a while to iron out them all but mine is also kinda out there.
I do not know of any official documentation that touches with this but I’m good.
PS. Just test what worries you, like, are you worried that there is a sleep issue when two users look at a RG and one creates something, just test it in the most simplest form. That would be so simple to test and only take you like 1 hour?
Then test if the RG updates if something is created from the backend, super easy to test.
I had no idea if half the stuff my app would even would even be possible to get working. I had to test so many things, and I had no idea if what I was building was even remotely possible to build.