File tree Expand file tree Collapse file tree
AmplifyClients/AmplifyKinesisClient Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ actor RecordClient {
9393 }
9494
9595 private func handleFailedRequest( _ records: [ Record ] ) async {
96- let retryable = records. filter { $0. retryCount + 1 < maxRetries }
97- let expired = records. filter { $0. retryCount + 1 >= maxRetries }
96+ let retryable = records. filter { $0. retryCount < maxRetries }
97+ let expired = records. filter { $0. retryCount >= maxRetries }
9898
9999 do {
100100 try await storage. incrementRetryCount ( ids: retryable. map ( \. id) )
@@ -104,7 +104,7 @@ actor RecordClient {
104104 let streamName = records [ 0 ] . streamName
105105 logger. warn (
106106 " Deleted \( expired. count) records from stream \( streamName) "
107- + " that exceeded retry limit of \( maxRetries) after failed request "
107+ + " that exceeded retry limit of \( maxRetries) after failed retries "
108108 )
109109 }
110110 } catch {
Original file line number Diff line number Diff line change @@ -102,6 +102,9 @@ class RecordClientFlushTests: XCTestCase {
102102 let allRecords = try await storage. getRecordsByStream ( ) . flatMap { $0 }
103103 let record2Id = allRecords [ 1 ] . id
104104 let record3Id = allRecords [ 2 ] . id
105+
106+ // Increment to maxRetries (3) so they are expired on next failed flush
107+ try await storage. incrementRetryCount ( ids: [ record2Id, record3Id] )
105108 try await storage. incrementRetryCount ( ids: [ record2Id, record3Id] )
106109 try await storage. incrementRetryCount ( ids: [ record2Id, record3Id] )
107110
You can’t perform that action at this time.
0 commit comments