I am making a chat applications and have come to a point where I am not sure how to solve a certain task and was wondering if you guys have a go to solutions and an idea on how to go on about fixing this specific issue with an architecture that makes sense:
I download all current Conversations the user has, these can be group conversations on private 1 on 1 conversations. I save this information in an object of the class ‘Conversation’. Now I would like to only once fully download all currently open conversations from the server and afterwards only receive changes (e.g conversation group name was changed) and adjust that in my clients data. I have a field conversation: Conversation in my Ionic component that handles showing these conversations and I can also save the list of all conversations using IonicStorage.
Now how would you go on about synching the IonicStorage conversations with the ones in the RAM (ionic component field)? For example if the user creates a new conversation, would you update the components conversation array and also at the same time add the new Conversation Object to the IonicStorage list?
Is there some sort of pattern or best practice, anyone has had any experience towards this?
Let me know!