Skip to content

Commit 08bf417

Browse files
authored
fix(IoT): Fixing a potential race condition on topic listeners (#5402)
1 parent b63dd81 commit 08bf417

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

AWSComprehendTests/AWSComprehendTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class AWSComprehendTests: XCTestCase {
139139
let comprehendClient = AWSComprehend.default()
140140
let detectSentimentRequest = AWSComprehendDetectSentimentRequest()
141141
detectSentimentRequest!.languageCode = AWSComprehendLanguageCode.en
142-
detectSentimentRequest!.text = "I have no strong feelings one way or the other"
142+
detectSentimentRequest!.text = "This sentence is a statement of fact"
143143

144144
comprehendClient.detectSentiment(detectSentimentRequest!).continueWith{ (task)-> Any? in
145145
if let error = task.error {

AWSIoT/Internal/AWSIoTMQTTClient.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ @interface AWSIoTMQTTClient() <AWSSRWebSocketDelegate, NSStreamDelegate, AWSMQTT
3838

3939
@property(atomic, assign, readwrite) AWSIoTMQTTStatus mqttStatus;
4040
@property(nonatomic, strong) AWSMQTTSession* session;
41-
@property(nonatomic, strong) NSMutableDictionary * topicListeners;
41+
@property(nonatomic, strong) AWSSynchronizedMutableDictionary * topicListeners;
4242

4343
@property(atomic, assign) BOOL userDidIssueDisconnect; //Flag to indicate if requestor has issued a disconnect
4444
@property(atomic, assign) BOOL userDidIssueConnect; //Flag to indicate if requestor has issued a connect
@@ -91,7 +91,7 @@ @implementation AWSIoTMQTTClient
9191

9292
- (instancetype)init {
9393
if (self = [super init]) {
94-
_topicListeners = [NSMutableDictionary dictionary];
94+
_topicListeners = [AWSSynchronizedMutableDictionary new];
9595
_clientCerts = nil;
9696
_session.delegate = nil;
9797
_session = nil;

CHANGELOG.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# AWS Mobile SDK for iOS CHANGELOG
22

3+
## Unreleased
4+
5+
### Bug Fixes
6+
7+
- **AWSIoT**
8+
- Fixing a potential race condition on topic listeners (#5402)
9+
10+
## 2.36.5
11+
12+
### New features
13+
14+
- **AWSIoT**
15+
- Adding completion callbacks for registerWithShadow and unregisterFromShadow methods (#5192)
16+
317
### Misc. Updates
418

519
- Model updates for the following services
@@ -16,11 +30,11 @@
1630
- AWSFirehose
1731
- AWSTranscribe
1832

19-
- **AWSS3**
20-
- fix(s3): cleanup file cache after mpu task is cancelled (#5128)
21-
22-
- **AWSIOT**
23-
- feat(IoT): Adding completion callbacks for registerWithShadow and unregisterFromShadow methods (#5192)
33+
## 2.36.4
34+
35+
### Deprecated release
36+
37+
This release is deprecated due to errors. Please use 2.36.5 or greater.
2438

2539
## 2.36.3
2640

0 commit comments

Comments
 (0)