GetStream / stream-chat-swift

💬 iOS Chat SDK in Swift - Build your own app chat experience for iOS using the official Stream Chat API
https://getstream.io/chat/sdk/ios/
Other
861 stars 211 forks source link

Fix sometimes failing test_loadPreviousReplies_whenMessagesAreEmpty_callDelegateWithEmptyChanges #3504

Closed laevandus closed 16 hours ago

laevandus commented 19 hours ago

🎯 Goal

Fix unstable test: test_loadPreviousReplies_whenMessagesAreEmpty_callDelegateWithEmptyChanges

🛠 Implementation

Unstable because it is checking delegate call counts, but did not properly wait for the initial background observer callback. This caused a race between initial fetch and the second load replies call. Failure was reproducible when running the unit-test locally with the repeat option.

☑️ Contributor Checklist

sonarcloud[bot] commented 17 hours ago

Quality Gate Passed Quality Gate passed

Issues
168 New issues
0 Accepted issues

Measures
0 Security Hotspots
83.7% Coverage on New Code
0.1% Duplication on New Code

See analysis details on SonarQube Cloud