Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix test case RealtimeClientPresenceTests.test__032__Presence__enter_…
…_entering_without_an_explicit_PresenceMessage_clientId_should_implicitly_use_the_clientId_of_the_current_connection This fixes the crash > Fatal error: Index out of range: file Swift/ContiguousArrayBuffer.swift, line 444 > (…) > (RealtimeClientPresenceTests.swift:1088) which comes from an out of bounds array access on the line > let received = transport.protocolMessagesReceived.filter { $0.action == .presence }[0].presence![0] I’m speculating that this failure is caused by the same thing as in 57b7266, 3f155f9, and 7c53cec - that is, that a .present is received instead of a .enter, causing the array to be empty (it is certainly vulnerable to this problem) - and hence am attempting the same fix. I’ve also swapped around the order of subscribing and publishing - although it probably doesn’t make a difference in reality since there’s asynchronous work involved in the publishing, conceptually it makes sense to subscribe before publishing. Test case: https://test-observability.herokuapp.com/repos/ably/ably-cocoa/test_cases/ac44f09c-f521-4bfc-a3d7-58d4f7428c74 Example failure: https://test-observability.herokuapp.com/repos/ably/ably-cocoa/failures/ac72c3e0-1211-4a1d-9a13-c62189734341 Closes #1333.
- Loading branch information