twilio / twilio-video-app-ios

A collaboration application built with the Twilio Video iOS SDK
Apache License 2.0
248 stars 54 forks source link

VIDEO-3719: Connect to chat #139

Closed timrozum closed 3 years ago

timrozum commented 3 years ago

https://issues.corp.twilio.com/browse/VIDEO-3719

Changes

  1. Added TwilioConversationsClient to app.
  2. Added ChatStore which will handle all of the SDK integration so that UI is simple and only doing UI work.
  3. Implemented connect which gets the client using token, gets the conversation, and loads recent messages. The team decided that for MVP we would simply enable the chat button on the room screen after the connect sequence is completely finished. Tapping the chat button will do nothing before connect finishes or if it fails.
  4. Implemented disconnect which tears everything down safely.
  5. The implementation strategy is to implement ChatStore before the final UI because the final UI will be kind of interesting. Meanwhile I will be implementing a placeholder UI with a few buttons and logging to test ChatStore.
  6. Add placeholder chat button to home screen.
  7. Output recent messages to log when chat screen is shown.

Testing

  1. While it would be valuable to unit test ChatStore there are challenges and I think we should focus on UI tests for the chat feature. To mock the SDK types I would have to do a lot of retroactive modeling and I think that would make it more difficult for customers to understand the code. And it is very likely there would be other surprises and problems because that always seems to be the case with testing SDK usage. So I think quarantining the SDK integration inside ChatStore and using UI tests is a better strategy. I think I will be able to get good coverage with a moderate number of UI tests. There is a separate ticket for UI tests after UI is finished.
  2. I manually tested connect, disconnect, reconnect. And verified that recent messages were output to log when chat screen was shown.

Simulator Screen Shot - iPhone 12 Pro - 2021-02-22 at 08 49 26 Simulator Screen Shot - iPhone 12 Pro - 2021-02-22 at 08 49 35