Closed cejanen closed 4 years ago
Since we have states
connecting
andconnected
I believe it would be nice to implement also reachability and whenever there is no network the state changes toconnecting
@schwarja Isnt that something else? We're using it to detect initial state. But if I imagine I loaded conversations and later just when sending message networks go down I dont wanna see any error or progress bar that whole chat component is connecting? Its connected -> means it knows its network layer and can communicate. At least what I feels it should be.
@cejanen I took inspiration from Messenger that indicates if there is no connection. It is a nice way to say: "We are trying our best to send your message but there is no internet connection right now"
As I suggested in the Trello ticket, I think we could have these states:
connected
@schwarja I added reachability into project. Again as file instead of pod. I also created reachability observer to wrap some observing and cleanup logic. There is try? bc it shouldnt throw regularly. At chat core I updated changes of chat core states. I was thing about adding any guard to all calls to avoid calling when state is connecting but I decided to keep it as it is and add this state changes as option to react at UI. Also this change would create all calls more complex.
Hopefully all good :-D
Added chat core state and its possible observation For now its just at core its question if we should propagate it to chat itself.