Backendless Version (6.1.2)
Client SDK (Objective-C)
Application ID B69AC5CA-35FA-097A-FF2C-8AE7BFD8C900
Test example app
To demonstrate the bug we prepared the minimal Objective-C macOS app for probing the issue. The app’s project is attached in the zip file. All our testing is done in RELEASE build configuration.
BackendlessTest.zip (13.8 MB)
Expected Behavior
- Start the app in release mode.
- Press ‘Login’ button to login with the test user (wait for successful login message)
- Press ‘Join default channel’
- Press ‘Add string message listener’
- Open your terminal and enter the curl command for publishing the message in the app’s default channel:
curl -X POST
https://api.backendless.com/B69AC5CA-35FA-097A-FF2C-8AE7BFD8C900/0278795F-7C5A-4F48-94F4-61B9D6954FF3/messaging/default
-H ‘content-type: application/json’
-d ‘{ “message”: “message” }’ - You should see in the app’s output log the received message.
- Press ‘Logout’
- Repeat the message publishing command from step 5.
- You should again see the received message in the app’s output log.
- Press ‘Is default channel joined’ and it should log that the channel is indeed joined.
- Press ‘Leave default channel’
- Press ‘Join default channel’ (wait for channel to join).
- Press ‘Is default channel joined’ and it should log that the channel is indeed joined.
Actual Behavior
- Start the app in release mode.
- Press ‘Login’ button to login with the test user (wait for successful login message)
- Press ‘Join default channel’
- Press ‘Add string message listener’
- Open your terminal and enter the curl command for publishing the message in the app’s default channel:
curl -X POST
https://api.backendless.com/B69AC5CA-35FA-097A-FF2C-8AE7BFD8C900/0278795F-7C5A-4F48-94F4-61B9D6954FF3/messaging/default
-H ‘content-type: application/json’
-d ‘{ “message”: “message” }’ - You should see in the app’s output log the received message.
- Press ‘Logout’
- Repeat the message publishing command from step 5.
- The message is never received although the default channel is still joined.
- Press ‘Is default channel joined’ and it should log that the channel is indeed joined.
- Press ‘Leave default channel’
- Press ‘Join default channel’ (you should wait and see that the default channel is never joined again).
- Press ‘Is default channel joined’ and it should log that the channel is not joined.
We noticed that on user logout (step 7) the Backendless messaging stops working properly on the client side. It seems that TCP connections responsible for the RT Messaging are closed for some reason and can’t be opened again by joining the channel. Our expectations are that we should still be able to use messaging after user logout. Even if we try to login again after logout, messaging still doesn’t work - we can’t receive the messages published to the channel we subscribed to. But message publishing still works.
We noticed the similar issue when we loose internet connectivity. To test this we turned off and on the wifi and we couldn’t receive the pubsub messages anymore.
Here is our app’s output log for the steps provided above:
Started login…
User has been logged in.
Started default channel join…
Default channel joined.
String message listener added.
Received message from default channel: message
Started logout…
User has been logged out
Default channel is joined: 1
Default channel should be left. Check with button ‘Is default channel joined.’
Started default channel join…
Default channel is joined: 0