Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Thali sequence update probably doesn't happen on no change which hurts perf badly #735
Imagine that phones A and B have both sync'd to the cloud and both have identical state. Neither phone however has synced directly with each other over local radios in some time.
The two phones then get in a room together. Both phone A and B will be advertising for each other because they will have checked the relevant _local/thali_X entries and see that they both have new data and haven't sync'd with the other phone in a while.
So now let's say that phone A connects to phone B and starts a pull replication. The pull replication should not (I think) trigger any change events because all of the docs and revs on B are already on A. So eventually the synch will go quiet and time out. But the problem is that right now we trigger an update to _local/thali_X based on changes and there are no changes in this case! So we won't ever tell B what A has sync'd up to. Which means that B is going to keep advertising for A even though there is actually nothing new to say!
The ideal fix is to figure out how to hook into the PouchDB replication process so that we can see that there are no changes and know to trigger a sequence update based on that.