How to differentiate untracking from crashed processes when using phoenix presence

Hi all, I’m trying a proof-of-concept for keeping state in a node cluster using phoenix pubsub + presence. In my tests I need to differentiate between untracking (which in my scenario is used when a process is exiting normally) and a process or node going missing.

I have tried altering the code in shard.ex to also pass an untrack: true parameter to the report_diff function but that only affects notifications on the node that triggered the untracking- all other nodes in the cluster are notified with a regular leave diff (the same as when a process or node crashes). I guess there is also some other place in the code that tracks and notifies about the shared state but I haven’t had any luck locating it thus far.

Anyone else tried this?

P.S. I’ve created a github repo for this here: