mongodb / stitch-ios-sdk

Apache License 2.0
42 stars 25 forks source link

STITCH-2211 Swift SDK: Create data models and implement local event coalescence #103

Closed jsflax closed 5 years ago

jsflax commented 5 years ago

"Port" the following classes:

InstanceSynchronization:

Other additions, notable or otherwise:

jsflax commented 5 years ago

Disregard that comment

On Thu 15 Nov 2018, 12:58 Jason Flax, notifications@github.com wrote:

@jsflax commented on this pull request.

In Core/Services/StitchCoreRemoteMongoDBService/Sources/StitchCoreRemoteMongoDBService/Sync/CoreDocumentSynchronizationConfig.swift https://github.com/mongodb/stitch-ios-sdk/pull/103#discussion_r233948518 :

  • locally emitted change event. This variant maintains the last version set.
    • parameter atTime: the time at which the write occurred.
    • parameter changeEvent: the description of the write/change.
  • */
  • mutating func setSomePendingWrites(atTime: TimeInterval,
  • changeEvent: ChangeEvent) {
  • // if we were frozen
  • if (isPaused) {
  • // unfreeze the document due to the local write
  • isPaused = false
  • // and now the unfrozen document is now stale
  • isStale = true
  • }
  • docLock.writeLock()

I ported over what happens on Android and assumed we had a reason for doing it this way. @edaniels https://github.com/edaniels?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mongodb/stitch-ios-sdk/pull/103#discussion_r233948518, or mute the thread https://github.com/notifications/unsubscribe-auth/AEJ7QEaXQkjHDJWTw8kICeszA-LbrNK9ks5uvasogaJpZM4YcyA1 .

jsflax commented 5 years ago

@adamchel @dkaminsky I think we should kick the versioning changes downfield until we get to that ticket. I've laid down the base model which arguably was in scope for this one.

Otherwise, I've addressed your remarks. PTAL.