Feature request - Show sent message before it returned from firebase? #118
-
Hi, I'm using the firebase_core also but I changed the backend to another server that is communicating with firebase (due to security reasons). |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
Hey @itaishalom I don't think this is possible. Of course you're the one who supplies the messages array to the chat UI, and you can easily add a message to the array, and it will be shown, however, when the message will be registered on a backend, it will 100% have a different ID and you will need to find your temporarily added message and update it's ID and I am afraid ID change will also trigger animation so you will get something like, message appears, disappears, appears. I don't remember if I have an option to disable the animation, I think it can be added, but it will not resolve initial issue that you will be adding 2 messages for one, so you have problems with queues and stuff and this is just too complex topic to start off, we are talking about offline first etc. Maybe if your backend would be able to accept temporarily created IDs and use them as a server side IDs, and then make a change in the chat UI to compare only IDs, something like that can work, but it is definitely not doable with Firebase, or at least too complex to even spend time on it. |
Beta Was this translation helpful? Give feedback.
-
After talking to @cristaloleg we think that having 2 IDs might help, like having current id as an indication of a message added to the chat but not received on the server and |
Beta Was this translation helpful? Give feedback.
-
Awesome! I'll test it on Thursday 😉 |
Beta Was this translation helpful? Give feedback.
Awesome! I'll test it on Thursday 😉