Sending a message to active sessions

Hello. I found the example project “Communicating between Sessions” and thought this would be a great addition to my app when I am about to push through an update, informing the users to save their work and log off in XXX minutes. However, it does not seem to be working

I deployed the example project to my Xojo Cloud. It showed me the two usernames I made in the two separate tabs on the same computer as the Admin page. On my other computer, I went to the URL, made a new username, but the admin page did not show the new user, nor the ability to send it a message

Is there something with the example project that only works on the device as the Admin page (the one you write the message and send)?

I am not completely sold on wanting to do things this way. Just found it in the examples and thought it would serve the purpose well. If anyone has other solutions for this purpose, I would be happy to hear

FWIW, in my actual app I am working on, the user logs into the app. I save the session ID and a status of Active/Offline to a table. I have an admin panel on my login so I can see all active sessions. This works just fine with seeing all of the active sessions, but I noticed no messages went through last week when I tried sending a message. This is when I thought I must’ve done something wrong, so I deployed the example project, but still this did not work

I think all Xojo Cloud accounts run at least 2 instances of your app (someone from Xojo can correct me here), think about that as running 2 web apps at the same time for load balance. Now if you connect to one instance you see those sessions, if you connect to the other instance you don’t see the other instance sessions.

You will need extra code to query all instances of your web app to check/communicate with all sessions.

If this is the case, maybe Xojo have a sample that works with their Xojo Cloud configuration.

This is the other problem. You will need to use two separate browsers, like Safari and Firefox, or Edge and Firefox, because a single browser will usually share the identifiers across tabs.

As for the first problem, you could make your admin function write a file to disc, let’s say a json string which contains the reason and the time when the update will be applied. Then add a Timer to the App class which looks for the file once a minute. If it finds it, it notifies all of the users that the app is going down, why and when. In app.opening you delete the file if it exists.

Thanks for the tips fellas. This gives me a starting point and some ideas

@Greg_O , your help on a previous thread helped me greatly with the redirecting those who try to sign on when there’s an update pending. I’ll look to implement something similar to your post here for notifying those already signed in. Thanks!