ReplicationChangeEventArgs don't match puller/pusher status


I’m having issues with one-shot replication, where the ReplicationChangeEventArgs are not in sync with the actual status of the puller and pusher. Following your documentation, I check for the status of the pullers/pushers with:

else if (Pull.Status == ReplicationStatus.Stopped && Push.Status == ReplicationStatus.Stopped)
AuthEvent(new AuthEventArgs(AuthStatus.Stopped, _progressPercent));

However it is entering the ‘stopped’ case twice. The first time it enters, the ‘ReplicationChangeEventArgs’ actually says that the replication changed to active, then the next time the eventArgs say stopped. I’m not sure if this is a bug or just a timing thing.


This is definitely a timing thing, and it is the exact reason that those arguments are present. This event fires asynchronously so by the time it gets there the replicator may have changed state again. The event arguments capture the state of the replicator at the moment the event was generated.