There are certain elements on my page where i have dynamic attribute show if localsession.data.loggedin==true
However even if this variable later turns false by loggig out in another tab, the elements still shows , unless the page is refreshed.
That is it’s show value is bound to a variable but it seems it only checks the variable on load?
what would be the best way to make it see the latest variable ? Schedule a flow every second ? Or some App event ? like mouse focus? Which event will be best ? Or am i doing something wrong and the element should be checking the dynamic attribute on its own even after page load?
yes sorry u can do that, i asked about your server language cause with nodejs u have websockets and the data can be updated in real time.
But with javascript the only way i can think is for example set an action to a button and u can bind the action to load your data, or with a schedule as u said before.
I have had to resort to similar tactics when building before I found Wappler; be aware if you have a large mobile user base that a lot of battery-saving daemons or settings in the manufacturer-provided browsers these days are getting obnoxious about killing these types of update cycles after say 30 seconds or 2 mins
We had an internal monitoring website used by about 200 Android and 450 iOS users that had this type of schedule data pull. Over the years that needed about 10 different workarounds to keep the JavaScript from getting put to sleep by Samsung phones, then LG, then even iOS seemed to do it (maybe extensions).
Anyway, nodejs seems to avoid this entirely if it is a fit otherwise.
Oh thanks a lot for the heads up. Will change the logic to run the flow as needed. I’m also using the scheduler to run some important flows, will change it
In my experience, events that are triggered by user-initated interactions of any kind are immune from the battery saving stuff - so a button or other interaction based request would seem a bit more reliable to me.
That said, I am new to Wappler and is hard to even be sure if this issue would affect Wappler created sites and apps - but I think it could. Please let us know if you find a good solution.