aslanyanhaik / Quick-Chat

Real time chat app written in Swift 5 using Firebase
MIT License
1.84k stars 360 forks source link

problem with loading message #6

Closed phucnd0604 closed 5 years ago

phucnd0604 commented 7 years ago

This app work well but i found a problem that when you open chat screen and the app load old message, because you use the observer for adding child so it will make the tableview update for each message. So when the conversation have about 1000 message or more (its possible) it call the update function 1000 times, its bad, the app may freeze or crash. Hope you can improve it.

aslanyanhaik commented 7 years ago

Thanks for this comment, didn't thought about this. Indeed it's not a good solution. I will fix this in upcoming version.

phucnd0604 commented 7 years ago

Sure, maybe you need to re-design the data structure, the conversation can only have 2 child: content (array of messages), last update. When the app get old messages, you can get message from content child, the last update can use for real time chat.

dev-vinoth commented 7 years ago

Need a fix +1

Michele404 commented 6 years ago

News?