From 0c91d909a930bf0a58671f3b5e992f7717367f48 Mon Sep 17 00:00:00 2001 From: JP Wright Date: Thu, 13 Jul 2017 15:42:48 +0200 Subject: [PATCH 1/2] Always send diffs to persistence integration after a sync page fetched --- Sources/Client.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Sources/Client.swift b/Sources/Client.swift index d2a33125..f602918b 100644 --- a/Sources/Client.swift +++ b/Sources/Client.swift @@ -694,7 +694,7 @@ extension Client { // Send messages to persistence layer about the diffs (pre-merge state). // Must send messages for the first sync space that was originally passed in. - self.sendDiffMessagesToPersistenceIntegration(for: syncSpace, resolvingLinksWith: newSyncSpace) + self.sendDiffMessagesToPersistenceIntegration(for: newSyncSpace, resolvingLinksWith: syncSpace) syncSpace.updateWithDiffs(from: newSyncSpace) completion(Result.success(syncSpace)) @@ -743,13 +743,16 @@ extension Client { fileprivate func sync(matching: [String: Any] = [:], completion: @escaping ResultsHandler) -> URLSessionDataTask? { return fetch(url: URL(forComponent: "sync", parameters: matching)) { (result: Result) in + if let syncSpace = result.value { + // Whenever we get a page, send the diffs to the persistence integration. + self.sendDiffMessagesToPersistenceIntegration(for: syncSpace, resolvingLinksWith: nil) + if syncSpace.hasMorePages == true { // multipage sync. self.nextSync(for: syncSpace, matching: matching, completion: completion) } else { - // Either a single page sync, or, in the recursive case of a multipage sync, the last page. - self.sendDiffMessagesToPersistenceIntegration(for: syncSpace, resolvingLinksWith: nil) + // Merge all the sync spaces together. completion(Result.success(syncSpace)) } } else { From 0182ce4146d572925a9562d0967351c0896c62c2 Mon Sep 17 00:00:00 2001 From: JP Wright Date: Mon, 17 Jul 2017 10:24:50 +0200 Subject: [PATCH 2/2] Update changelog, readme, and bump version number for 0.7.3 patch --- .env | 2 +- .envrc | 2 +- CHANGELOG.md | 10 +++++++++- Config.xcconfig | 2 +- README.md | 4 ++-- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.env b/.env index 63119218..28b7c22d 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -CONTENTFUL_SDK_VERSION=0.7.2 +CONTENTFUL_SDK_VERSION=0.7.3 diff --git a/.envrc b/.envrc index 78179cbb..2432f510 100644 --- a/.envrc +++ b/.envrc @@ -1 +1 @@ -export CONTENFUL_SDK_VERSION=0.7.2 +export CONTENFUL_SDK_VERSION=0.7.3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 436fb96a..20670e89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) starting from ## Table of contents #### 0.x Releases -- `0.7.x` Releases - [0.7.0](#070) | [0.7.1](#071) | [0.7.2](#072) +- `0.7.x` Releases - [0.7.0](#070) | [0.7.1](#071) | [0.7.2](#072)) | [0.7.3](#073) - `0.6.x` Releases - [0.6.0](#060) | [0.6.1](#061) - `0.5.x` Releases - [0.5.0](#050) - `0.4.x` Releases - [0.4.0](#040) | [0.4.1](#041) @@ -18,6 +18,14 @@ This project adheres to [Semantic Versioning](http://semver.org/) starting from --- +## [`0.7.3`](https://github.com/contentful/contentful.swift/releases/tag/0.7.3) +Released on 2017-07-17 + +#### Fixed +- Delta messages from `/sync` endpoint were only being sent for last page when a sync was returned on multiple pages. + +--- + ## [`0.7.2`](https://github.com/contentful/contentful.swift/releases/tag/0.7.2) Released on 2017-07-12 diff --git a/Config.xcconfig b/Config.xcconfig index 63119218..28b7c22d 100644 --- a/Config.xcconfig +++ b/Config.xcconfig @@ -1 +1 @@ -CONTENTFUL_SDK_VERSION=0.7.2 +CONTENTFUL_SDK_VERSION=0.7.3 diff --git a/README.md b/README.md index 92fefa3d..f7fd95bd 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ pod 'Contentful' You can specify a specific version of Contentful depending on your needs. To learn more about operators for dependency versioning within a Podfile, see the [CocoaPods doc on the Podfile][7]. ```ruby -pod 'Contentful', '~> 0.7.2' +pod 'Contentful', '~> 0.7.3' ``` Note that for Swift 2.3 support (contentful.swift `v0.2.3`) you will need to add a post-install script to your Podfile if installing with Cocoapods: @@ -100,7 +100,7 @@ end You can also use [Carthage][8] for integration by adding the following to your `Cartfile`: ``` -github "contentful/contentful.swift" ~> 0.7.2 +github "contentful/contentful.swift" ~> 0.7.3 ``` ## License