Skip to content

Commit

Permalink
Fix remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Hopsaheysa committed Mar 18, 2024
1 parent fc7d683 commit 4d86e4c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class WMTOperationsImpl<T: WMTUserOperation>: WMTOperations, WMTService {
private var isPollingPaused: Bool { return pollingTimer?.isValid == false }
private let pollingLock = WMTLock()
private var notificationObservers = [NSObjectProtocol]()
private let minimumTimePollingInterval = TimeInterval(5)
private let minimumTimePollingInterval = 5.0

/// Operation register holds operations in order
private lazy var operationsRegister = OperationsRegister { [weak self] ops, added, removed in
Expand Down Expand Up @@ -406,8 +406,6 @@ class WMTOperationsImpl<T: WMTUserOperation>: WMTOperations, WMTService {
return
}

let requestStartDate = Date()

networking.post(data: .init(), signedWith: .possession(), to: WMTOperationEndpoints.List<T>.endpoint) { response, error in

assert(Thread.isMainThread)
Expand Down
16 changes: 8 additions & 8 deletions WultraMobileTokenSDK/Operations/WMTOperations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public protocol WMTOperations: AnyObject {
///
/// If operations are already polling this call is ignored and
/// polling interval won't be changed.
/// - Parameter interval: Polling interval
/// - Parameter interval: Polling interval, minimum is 5s
/// - Parameter delayStart: When true, polling starts after
/// the first `interval` time passes
func startPollingOperations(interval: TimeInterval, delayStart: Bool)
Expand Down Expand Up @@ -158,14 +158,14 @@ public extension WMTOperations {

/// Starts the operations polling.
///
/// The default value for `interval` is 7 seconds
/// Deafula implementation of startPollingOperations
/// The `interval` is set to 7 seconds, with a minimum value of 5 seconds.
///
/// If operations are already polling this call is ignored and
/// polling interval won't be changed.
/// - Parameter delayStart: When true, polling starts after
/// the first `interval` time passes
func startPollingOperations(delayStart: Bool) {
return startPollingOperations(interval: TimeInterval(7), delayStart: delayStart)
/// - Parameters:
/// - interval: Default is set to 7 seconds, with a minimum value of 5 seconds.
/// - delayStart: Default is set to true. Polling starts after the first `interval` time passes
func startPollingOperations() {
return startPollingOperations(interval: 7, delayStart: true)
}
}

Expand Down
6 changes: 3 additions & 3 deletions WultraMobileTokenSDKTests/IntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -356,16 +356,16 @@ class IntegrationTests: XCTestCase {
XCTAssertFalse(ops.isPollingOperations)
let delegate = OpDelegate()
delegate.loadingCountCallback = { count in
if count == 4 {
if count == 3 {
self.ops.stopPollingOperations()
exp.fulfill()
}
}
ops.delegate = delegate
ops.startPollingOperations(interval: 1, delayStart: false)
ops.startPollingOperations()
XCTAssertTrue(ops.isPollingOperations)

waitForExpectations(timeout: 20, handler: nil)
waitForExpectations(timeout: 30, handler: nil)

XCTAssertFalse(ops.isPollingOperations)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## 1.10.0

- Removed `currentServerTime` property [(#148)](https://github.com/wultra/mtoken-sdk-android/pull/139)
- Implemented default and minimum pollingInterval [(#151)](https://github.com/wultra/mtoken-sdk-ios/pull/151)
- Added default and minimum pollingInterval [(#151)](https://github.com/wultra/mtoken-sdk-ios/pull/151)

## 1.9.0 (Jan 24, 2024)

Expand Down

0 comments on commit 4d86e4c

Please sign in to comment.