[lib] create hook to run Device List Update Protocol
Summary:
ENG-9905.
Currently, updating the device list and broadcasting device list update is easily coupled in the codebase, which makes it hard to maintain, as those two should always be done together. I just wanted to create one call that matches 5.3 from the whitepaper:
This is not fully correct yet, we need to change to order to first send the device list update to all the peers, but it's not yet possible before ENG-9769. Creating ENG-9948 to address that.
I am still keeping util functions, bad for readability but those are used in unit tests.
Logic should remain mostly unchanged, small changes are annotated with inline comments.
Test Plan:
Tested later in the stack but:
- Log in secondary device
- Log out secondary device
- Remove device from Linked Devices list
And making sure that device list updates are disseminated
Reviewers: bartek, tomek, varun, ashoat
Reviewed By: bartek, ashoat
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D13963