We want to make sure everyone in a channel is eventually in sync. We should be aggressive about this!
We should create edge cases to try to break sync. (e.g., network gets split, morning crew talks and go offline, evening crew appears, as soon as two from both are online they should sync.)
One approach:
every message includes HEAD of repo. If HEAD shows that user has more messages than you, you git fetch. Git fetch retries if that user is busy with exponential backoff.
If you see someone with a HEAD behind you, you reply in a hidden message with your HEAD.
Users send a special message on join to the channel so others can see they are online. This announces their HEAD. If their head is behind, they'll get replies with a later HEAD, which will trigger fetch.
We want to make sure everyone in a channel is eventually in sync. We should be aggressive about this!
We should create edge cases to try to break sync. (e.g., network gets split, morning crew talks and go offline, evening crew appears, as soon as two from both are online they should sync.)
One approach: