parley-messaging / ios-library

Parley iOS app library
MIT License
2 stars 2 forks source link

Make sure the pollingService is setup once the messagesManager is available #137

Closed nlamah closed 2 weeks ago

nlamah commented 2 weeks ago

Make sure the pollingService is setup once the messagesManager is available. When the view is initialised, but Parley is not configured yet, polling service is not configured once the parley is configured. This Pull Request fixes that.

nlamah commented 2 weeks ago

@alexkok I am not sure that this change is fixing all issues I have at the moment with the PollingService. I am trying to reproduce my issue in the example app. The issue is that although polling is happening, and when an new message is delegated to the ParleyView, the tableView is reloaded, the cell is not visible. Does this perhaps sound familiar?

alexkok commented 2 weeks ago

Thanks, this fix helps for sure.

Unfortunately what you describe (the not visible cell on polling), is not what we see happening. Doesn't sound familiar either. Tested both with polling and push, new messages are neatly added.

Note: know that polling has a backoff mechanism to not poll too much when there's no messages for a while (it goes to the next interval after 5 polls that didn't receive new messages):

private enum TimerInterval: TimeInterval {
        case twoSeconds = 2
        case fiveSeconds = 5
        case tenSeconds = 10
        case thirtySeconds = 30
    }

Could this be related to what your findings are? If so, it is intended behavior, but the message should show up on the next poll that is happening.

If not, would be great to find how to reproduce in the demo app. Let's make a new issue (or PR) when you've found some clues. We will merge & release this one in the meanwhile 👍

alexkok commented 2 weeks ago

Released in 4.1.5 🚀

nlamah commented 2 weeks ago

@alexkok The issue that I have is not related to the timerInterval. In this pull request I added a unit test that shows the issue: https://github.com/parley-messaging/ios-library/pull/140