Node version v8.11.3
Npm version v6.2.0
Npm package realm v2.14.0
I have a global event listener which listens to events on all users realms
, adminUser, NOTIFIER_PATH, 'change', handleChange)
Which works perfectly, but when I want to open users realm as some admin user and change something, the change that is made this way also triggers the callback and I have no way of knowing if the change was made by the realm owner (regular user) or the server (admin user).
, user: adminUser}})
I am aware that using change_event.realm object from the event listener callback to write the changes will not trigger the callback again (not cause a recursion) but I have the need to sometimes make the changes to users realms outside this callback. Which, as I already said, I do by opening a connection to that users realm as an admin user and use that instance to write the changes.
So my question is, is there another way of doing this so it does not trigger the listener callback? Or at least is there a way of distinguishing the realm user that made the change in the listener callback?