Live Queries User “online” Status

Hello good day, I have come this far because I have looked for all the ways to know when a user is online and offline and that my other clients know about it.

I have seen the Parse.Cloud.onLiveQueryEvent method but it only informs me of the number of users connected, but I need to know which user exactly connected, and then proceed to execute the function that is online.

I have seen that some execute a query every 2 seconds informing the server parse, this is not an option for me, the more users the server has it will go crazy, I just need to capture the clients that enter LiveQuery and those that are disconnecting from the server side, NOT CUSTOMER, and if it were possible (it would be perfect) it is to be able to send your ParseUser object id when connecting and that my server parse can obtain that information, also when it is disconnected.

Please if you have another idea of ​​how to solve this I would be very happy, I hope you can help me, thanks.

As peer the docs, the events also have the installation id and the session token. You can use either informations to track the user that is going online/offline. Have you tried this?

Why does everything return null when disconnected? if this is how I can know which user disconnected, it was perfect for when it connects, but I cannot know when it disconnects, is it because of the version of parse cloud?

Code:

Parse.Cloud.onLiveQueryEvent(({

event,

client,

sessionToken,

useMasterKey,

installationId,

clients,

subscriptions,

error

}) => {

if(event=="ws_disconnect"){

    console.log(event,

        client,

        sessionToken,

        useMasterKey,

        installationId,

        clients,

        subscriptions,

        error);

}

//nuevoEvento(event,sessionToken);

});

output:

ws_disconnect undefined undefined false undefined 0 0 undefined

help me please

They shouldn’t be undefined as you can see here. What is the version of Parse Server that you are running?