React Native CBL: how to get notification that sync is completed?

In iOS and Android native CBL modules there are corresponding methods for getting notified when one-shot synchronisation with SG is done.

But I can’t figure out what is reliable way to get the same in RN CBL
I think of using server.get_active_tasks like this:

    return cbl.server.get_active_tasks()
      .then((task)=> {
            if (task.status === 200) {
              if (task.data === '[]') {
                // here we should know that sync is completed
               }
             )

but not sure if it’s what I need to ensure that sync is really done for that particular client.

Thank you for any suggestions.

Basically, yes, as long as there’s only one replication task. You’ll need to poll by calling this every second or two while replication is running.

Thank you for clarification.

But how can I make sure that response to requst

server.get_active_tasks()

is related to that particular client only?
In my setup there could be potentially thousands of mobile clients accessing SG with predifined credentilas like “notregisteredyet / initialpassword” (replacement of the guest account). Will it work this way?