Compare commits

..

No commits in common. "160f48679b5343dea50b7f4eb8b70ac95a5d3187" and "849882287f2c2f117a49ee6bae162755802b5cd5" have entirely different histories.

4 changed files with 1 additions and 12 deletions

View File

@ -83,7 +83,7 @@ public class Client {
completion(.failure(Error(request: request, type: .invalidResponse))) completion(.failure(Error(request: request, type: .invalidResponse)))
return return
} }
guard response.statusCode == 200 || request.additionalAcceptableHTTPCodes.contains(response.statusCode) else { guard response.statusCode == 200 else {
let mastodonError = try? Client.decoder.decode(MastodonError.self, from: data) let mastodonError = try? Client.decoder.decode(MastodonError.self, from: data)
let type: ErrorType = mastodonError.flatMap { .mastodonError(response.statusCode, $0.description) } ?? .unexpectedStatus(response.statusCode) let type: ErrorType = mastodonError.flatMap { .mastodonError(response.statusCode, $0.description) } ?? .unexpectedStatus(response.statusCode)
completion(.failure(Error(request: request, type: type))) completion(.failure(Error(request: request, type: type)))

View File

@ -38,8 +38,6 @@ extension Timeline {
request.queryParameters.append("local" => true) request.queryParameters.append("local" => true)
} }
request.range = range request.range = range
// 206 can happen when the timeline is being regenerated and therefore is incomplete
request.additionalAcceptableHTTPCodes = [206]
return request return request
} }
} }

View File

@ -13,7 +13,6 @@ public struct Request<ResultType: Decodable>: Sendable {
let endpoint: Endpoint let endpoint: Endpoint
let body: Body let body: Body
var queryParameters: [Parameter] var queryParameters: [Parameter]
var additionalAcceptableHTTPCodes: [Int] = []
init(method: Method, path: Endpoint, body: Body = EmptyBody(), queryParameters: [Parameter] = []) { init(method: Method, path: Endpoint, body: Body = EmptyBody(), queryParameters: [Parameter] = []) {
self.method = method self.method = method

View File

@ -14,7 +14,6 @@ import UserAccounts
import ComposeUI import ComposeUI
let stateRestorationLogger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "StateRestoration") let stateRestorationLogger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "StateRestoration")
private let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "AppDelegate")
@UIApplicationMain @UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate { class AppDelegate: UIResponder, UIApplicationDelegate {
@ -95,13 +94,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return Preferences.shared.reportErrorsAutomatically ? event : nil return Preferences.shared.reportErrorsAutomatically ? event : nil
} }
} }
if let clazz = NSClassFromString("SentryInstallation"),
let objClazz = clazz as AnyObject as? NSObjectProtocol,
objClazz.responds(to: Selector(("id"))),
let id = objClazz.perform(Selector(("id"))).takeRetainedValue() as? String {
logger.info("Initialized Sentry with installation/user ID: \(id)")
}
} }
override func buildMenu(with builder: UIMenuBuilder) { override func buildMenu(with builder: UIMenuBuilder) {