strvcom / ios-chat-component

Chat modular library
MIT License
1 stars 1 forks source link

Feature/firebase users #38

Closed cejanen closed 4 years ago

cejanen commented 4 years ago

Well. First version of firebase authentication flow before showing chat content. This task shows us few weaknesses of our chat component architecture and also little pitfalls we need to solve. Bc I also merged with huge merge of conversation list it makes it even worse. I also reviewed user flow and make major change in its behavior. Few notes: 1) for now I put back network_pods back to ChatApp. Bc there is simple firebase auth flow almost all pods are needed there as well 2) Chat component has to be instantiated in didFinishLaunchingWithOptions in app delegate (its added also to readme) bc of background scheduled tasks 3) Bc when chat is already initialized it needs approach to set user later. It makes more sense to set it at core layer than go directly to network layer as it was in config before. 4) using two firestore references makes crash, thats the reason why firebase auth call terminate at the end 5) I wanted to have chat network layer better configurable so configuration was enhanced to allow set direct reference to firestore. This option is for now crashing. But it will be needed when app uses one firestore. I need to study more about firestore and targets and references. We need to figure this out for future. 6) We dont have approach for now (even before) to resend messages to proper user :-D Bc we cache / resend mesasages for current user. 6a) we need to call that method after user is set (its not for now) second if a login as somebody else next time resend will be under this new user which is wrong (potentially sensitive data can leak) 7) I removed static references from UI VCs for sender. Current user is at core and as it conforms SenderType it doesnt need to be sender there.

This is more like Beta and we should figure out how to solve few edge cases of our chat component.

schwarja commented 4 years ago

@cejanen When I added the url scheme I got a different crash: Terminating app due to uncaught exception 'FIRInvalidArgumentException', reason: 'Unsupported type: NSURL (found in field imageUrl)'

Reason here: https://stackoverflow.com/questions/50624805/swift-firinvalidargumentexception-reason-unsupported-type-nsurl-found-in/50625841

cejanen commented 4 years ago

@schwarja in common - I havent tested sing up just sign in so I will finish that all extra not needed work with sendertype was because there were warnings from messageKit and also user is in core. I merged with dev so place for indents etc.

cejanen commented 4 years ago

@schwarja Solved found issue with double resending cached messages (if else) Created app version of user Created google sign up Changed a bit user flow Created property wrapper for required property (used for network layer) Add test of current user at chat core (not used property wrapper bc of no usage of property itself) Hopefully fixed all bugs/comments etc

cejanen commented 4 years ago

@schwarja I polished the code also merged with dev and solved Todos left from other PR