Can I enforce sync order using a push filter and pendingDocumentIDs?

I have documents A and B where A needs to be synced before B.

Can I use a push filter and pendingDocumentIDs to do this? My plan was to, in the push filter, check the if A is in pending docs, and block B if it is. Will this work?

My use case is that both documents were created when the app was offline and are synced at the same time.

If you do this, there is a chance that B will not sync at all. If you want to do this logic, you can set up a second one shot replicator with docIDs filtered to just A, run that to completion, and then start the normal replication.

Thanks for the reply. Can you explain why B might never sync?

Because the pull and push filters are meant for static evaluation so a failure of these is not intended to be recoverable.

There is no way to enforce ordering in replication.

If you describe the higher-level problem that is causing you to want this, maybe we can resolve that in another way.