nextcloud / talk-ios

📱😀 Video & audio calls through Nextcloud on iOS
GNU General Public License v3.0
148 stars 91 forks source link

Correctly handle "too_many_requests" error #1676

Closed SystemKeeper closed 3 months ago

SystemKeeper commented 3 months ago

Currently we try to resume a session every time when we know a resumeId. This is problematic after changes to the signaling server, namely https://github.com/strukturag/nextcloud-spreed-signaling/pull/744/commits/4c807c86e83dbcb2958b9d4da0ad75d0d9417588.

This PR fixes this by:

SystemKeeper commented 3 months ago

I am wondering, do we need to set the disconnectTime also in one of the delegates ? But then we don’t know, when the disconnect really happened?! Or only in the close delegate?

Ivansss commented 3 months ago

I guess it makes sense to add it in the close delegate. It might make sense to also add it - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error in case of an error?

SystemKeeper commented 3 months ago

It might make sense to also add it - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error in case of an error?

That's were I am not sure. When an error occurs, it should be fine to reconnect and resume a session, wouldn't it? Also, when is this called, is it also called when the app was a while in the background and the web socket fails? In this case, we should not set the disconnectTime as this will not reflect the "real" disconnect time on the server?