We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a message fails to be sent and enters the resend queue, you will never receive a resend failure callback.
Relevant code:
WKRetryManager.m -(void) retrySend{ [self.retryLock lock]; NSArray *keys = self.retryDict.allKeys; [self.retryLock unlock]; for (NSString *key in keys) { [self.retryLock lock]; WKRetryItem *item = self.retryDict[key]; [self.retryLock unlock]; NSTimeInterval now = [[NSDate date] timeIntervalSince1970]; // 如果重试次数小于目标重试次数并且满足重试时间,则重试 if(item && item.retryCount<[WKSDK shared].options.messageRetryCount) { if(item.retryCount<[WKSDK shared].options.messageRetryCount ) { if((now - item.nextRetryTime)>=0) { if([WKSDK shared].isDebug) { NSLog(@"重发消息 key:[%@] retryCount: [%ld] nextRetryTime: [%ld]",key,item.retryCount,item.nextRetryTime); } item.retryCount++; item.nextRetryTime =now+[WKSDK shared].options.messageRetryInterval; [[[WKSDK shared] chatManager] sendMessage:item.message addRetryQueue:false]; } }else { // 超过重试次数 消息状态设置为发送失败 [self.retryLock lock]; [self.retryDict removeObjectForKey:key]; [self.retryLock unlock]; // 更新消息状态为失败 item.message.status =WK_MESSAGE_FAIL; [[WKMessageDB shared] updateMessageStatus:WK_MESSAGE_FAIL withClientSeq:item.message.clientSeq]; // 通知上层 [[WKSDK shared].chatManager callMessageUpdateDelegate:item.message]; } } } }
The code [[WKSDK shared].chatManager callMessageUpdateDelegate:item.message] will never be excuted.
[[WKSDK shared].chatManager callMessageUpdateDelegate:item.message]
Logs:
重发消息 key:[26] retryCount: [0] nextRetryTime: [1720074011] 重发消息 key:[26] retryCount: [1] nextRetryTime: [1720074021] 重发消息 key:[26] retryCount: [2] nextRetryTime: [1720074031] 重发消息 key:[26] retryCount: [3] nextRetryTime: [1720074041] 重发消息 key:[26] retryCount: [4] nextRetryTime: [1720074051] 重发消息 key:[26] retryCount: [5] nextRetryTime: [1720074061] 重发消息 key:[26] retryCount: [6] nextRetryTime: [1720074071] 重发消息 key:[26] retryCount: [7] nextRetryTime: [1720074081]
The text was updated successfully, but these errors were encountered:
Resolved with PR #5
Sorry, something went wrong.
No branches or pull requests
When a message fails to be sent and enters the resend queue, you will never receive a resend failure callback.
Relevant code:
The code
[[WKSDK shared].chatManager callMessageUpdateDelegate:item.message]
will never be excuted.Logs:
The text was updated successfully, but these errors were encountered: