ably / ably-cocoa

iOS, tvOS and macOS Objective-C and Swift client library SDK for Ably realtime messaging service
https://ably.com/download
Apache License 2.0
46 stars 25 forks source link

[ECO-4858] TO3g compliance #1941

Closed maratal closed 4 months ago

maratal commented 5 months ago

Closes #1936, #1938 and #1940

These three bugs were cancelling each other, so it's impossible to address them in different PRs since to fix all the tests failures you need to fix other two bugs. Please see commit messages and review per commit basis.

See also https://github.com/ably/specification/pull/194

Some additional info for commits messages.

d60269af "Proceeding with detach on CONNECTED":

What happens here is that in addition to re-attach we need re-detach as well to continue the process after connection becomes CONNECTED. But in oppose to attach there were no internal method for doing so, that's why I've splitted _detach into internalDetach: which doesn't do state check before proceeding with detaching. Also because detach message shouldn't be queued I've removed shouldQueueEvents check from the detachAfterChecks.

305d8db3 "Sending queued messages should be after reattach":

If you send message before sending ATTACH, realtime won't respond and tests will timeout. You can check it with test__065__Channel__publish__Message_connectionId_should_match_the_current_Connection_id_for_all_published_messages test.

16b38064 "Only queue publish and presence messages":

The check else if (msg.ackRequired) you should read as "if message can be queued", since ACK required with the same condition as queuing - message is either MESSAGE or PRESENCE. Also I've added log line if message sending was ignored.

maratal commented 5 months ago

Closed by mistake