From 51a1562e4bf9e66e36d63fcb5d851395e06cd531 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 6 May 2019 05:28:02 -0500 Subject: [PATCH] make slight change to how not modified responses are handled --- Frameworks/Account/Account.swift | 2 +- .../Account/Feedbin/FeedbinAPICaller.swift | 2 +- .../Feedbin/FeedbinAccountDelegate.swift | 20 ++++--------------- submodules/RSWeb | 2 +- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/Frameworks/Account/Account.swift b/Frameworks/Account/Account.swift index de2f85eb1..853d1be0e 100644 --- a/Frameworks/Account/Account.swift +++ b/Frameworks/Account/Account.swift @@ -285,7 +285,7 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, delegate.refreshAll(for: self, completionHandler: completion) } - public func update(_ feed: Feed, with parsedFeed: ParsedFeed, _ completion: @escaping RSVoidCompletionBlock) { + public func update(_ feed: Feed, with parsedFeed: ParsedFeed, _ completion: @escaping (() -> Void)) { feed.takeSettings(from: parsedFeed) diff --git a/Frameworks/Account/Feedbin/FeedbinAPICaller.swift b/Frameworks/Account/Feedbin/FeedbinAPICaller.swift index bb71f3152..f4e8e8b52 100644 --- a/Frameworks/Account/Feedbin/FeedbinAPICaller.swift +++ b/Frameworks/Account/Feedbin/FeedbinAPICaller.swift @@ -47,7 +47,7 @@ final class FeedbinAPICaller: NSObject { } - func retrieveTags(completionHandler completion: @escaping (Result<[FeedbinTag], Error>) -> Void) { + func retrieveTags(completionHandler completion: @escaping (Result<[FeedbinTag]?, Error>) -> Void) { let callURL = feedbinBaseURL.appendingPathComponent("tags.json") let conditionalGet = accountMetadata?.conditionalGetInfo[AccountMetadata.ConditionalGetKeys.tags] diff --git a/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift b/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift index e27a420a5..ecf17fcde 100644 --- a/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift +++ b/Frameworks/Account/Feedbin/FeedbinAccountDelegate.swift @@ -85,13 +85,15 @@ private extension FeedbinAccountDelegate { self?.syncFolders(account, tags) completion(.success(())) case .failure(let error): - self?.checkErrorOrNotModified(error, completion: completion) + completion(.failure(error)) } } } - func syncFolders(_ account: Account, _ tags: [FeedbinTag]) { + func syncFolders(_ account: Account, _ tags: [FeedbinTag]?) { + + guard let tags = tags else { return } let tagNames = tags.map { $0.name } @@ -121,18 +123,4 @@ private extension FeedbinAccountDelegate { } - func checkErrorOrNotModified(_ error: Error, completion: @escaping (Result) -> Void) { - switch error { - case TransportError.httpError(let status): - if status == HTTPResponseCode.notModified { - completion(.success(())) - } else { - completion(.failure(error)) - } - default: - completion(.failure(error)) - } - - } - } diff --git a/submodules/RSWeb b/submodules/RSWeb index cb3910180..903f6dae0 160000 --- a/submodules/RSWeb +++ b/submodules/RSWeb @@ -1 +1 @@ -Subproject commit cb3910180cd6af904b02b08f4044416326074844 +Subproject commit 903f6dae0a91f382e310a30aa690eb12569cfff4