Skip to content

Commit

Permalink
Merge pull request #135 from surfstudio/SPT-1998-fix-migration-problems
Browse files Browse the repository at this point in the history
SPT 1998 Правки после попытки миграции (5)
  • Loading branch information
mrandrewsmith authored May 24, 2024
2 parents 8249cb1 + 09fdbc8 commit eecafb0
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 128 deletions.
2 changes: 1 addition & 1 deletion NodeKit/NodeKit/CacheNode/ETag/URLETagSaverNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Foundation
/// Содержит указатель на UserDefaults-хранилище для eTag токенов.
extension UserDefaults {
/// Хранилище для eTag-токенов
static var etagStorage = UserDefaults(suiteName: "\(String(describing: self.self))")
static var etagStorage = UserDefaults(suiteName: "\(String(describing: UserDefaults.self))")
}

/// Этот узел сохраняет пришедшие eTag-токены.
Expand Down
2 changes: 2 additions & 0 deletions NodeKit/NodeKit/CacheNode/URLCacheWriterNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import Foundation
/// в которой не учитываются server-side политики и прочее.
/// Подразумечается, что этот узел не входит в цепочку, а является листом одного из узлов.
open class URLCacheWriterNode: AsyncNode {

public init() { }

/// Формирует `CachedURLResponse` с политикой `.allowed`, сохраняет его в кэш,
/// а затем возвращает сообщение об успешной операции.
Expand Down
10 changes: 5 additions & 5 deletions NodeKit/NodeKit/Layers/Utils/AccessSafe/AccessSafeNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public enum AccessSafeNodeError: Error {
/// - SeeAlso:
/// - `TransportLayerNode`
/// - `TokenRefresherNode`
open class AccessSafeNode: AsyncNode {
open class AccessSafeNode<Output>: AsyncNode {

/// Следующий в цепочке узел.
public var next: any TransportLayerNode
public var next: any AsyncNode<TransportURLRequest, Output>

/// Цепочка для обновления токена.
/// Эта цепочкаа в самом начале должна выключать узел, который имплементирует заморозку запросов и их возобновление.
Expand All @@ -62,7 +62,7 @@ open class AccessSafeNode: AsyncNode {
/// - Parameters:
/// - next: Следующий в цепочке узел.
/// - updateTokenChain: Цепочка для обновления токена.
public init(next: some TransportLayerNode, updateTokenChain: some AsyncNode<Void, Void>) {
public init(next: some AsyncNode<TransportURLRequest, Output>, updateTokenChain: some AsyncNode<Void, Void>) {
self.next = next
self.updateTokenChain = updateTokenChain
}
Expand All @@ -72,7 +72,7 @@ open class AccessSafeNode: AsyncNode {
open func process(
_ data: TransportURLRequest,
logContext: LoggingContextProtocol
) async -> NodeResult<Json> {
) async -> NodeResult<Output> {
await .withCheckedCancellation {
await next.process(data, logContext: logContext)
}
Expand All @@ -91,7 +91,7 @@ open class AccessSafeNode: AsyncNode {
private func processWithTokenUpdate(
_ data: TransportURLRequest,
logContext: LoggingContextProtocol
) async -> NodeResult<Json> {
) async -> NodeResult<Output> {
await .withCheckedCancellation {
await updateTokenChain.process((), logContext: logContext)
.asyncFlatMap { await next.process(data, logContext: logContext) }
Expand Down
4 changes: 1 addition & 3 deletions NodeKit/NodeKitMock/Builder/ChainBuilderMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

import Foundation

open class ChainBuilderMock<Route: URLRouteProvider>: ChainBuilder {

public init() { }
open class ChainBuilderMock<Route: URLRouteProvider>: ChainConfigBuilderMock, ChainBuilder {

public var invokedRoute = false
public var invokedRouteCount = 0
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class AccessSafeNodeTests: XCTestCase {

// MARK: - Sut

private var sut: AccessSafeNode!
private var sut: AccessSafeNode<Json>!

// MARK: - Lifecycle

Expand Down

This file was deleted.

0 comments on commit eecafb0

Please sign in to comment.