mongodb / stitch-ios-sdk

Apache License 2.0
42 stars 25 forks source link

STITCH-2212 Swift SDK: Create a skeleton for sync operations and the data synchronizer #106

Closed jsflax closed 5 years ago

jsflax commented 5 years ago

Add the skeletons for CoreSync and DataSynchronizer. We (essentially) get the entirety CoreSync here for free, since on Swift, it is a simple delegate for the DataSynchronizer.

This includes the NetworkMonitor and AuthMonitor protocols.

I've also added an internal FatalErrorListener for the arbitrary lower-level errors that can occur due to MongoSwift or otherwise. It is meant to listen for "impossible states", and will pass along whatever information it can to the user.

Though the PR seems large, much of it is tests/comments, and many of the DataSynchronizer methods are stubs. This should allow us to not step on each other for future tickets.

dkaminsky commented 5 years ago

As discussed, a follow-up tech debt JIRA ticket should be created to rationalize the error handling into a consistent framework -- ideal dichotomy of "recoverable errors" (passed to a handler) vs "non-recoverable errors" (propagated)