-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: optimistic DB and UI updates for reactions and messages #1758
Conversation
e96e3f1
to
55c68c1
Compare
55c68c1
to
7b8bbbe
Compare
3dceb6a
to
5cde25e
Compare
e06c965
to
04257ce
Compare
04257ce
to
f3812ff
Compare
be79ba2
to
0595af0
Compare
Some of the findings/questions from my manual testing run |
When sending a "/giphy cat" message (when offline), it's not possible to resend it when establishing an internet connection again. This results in an exclamation mark bubble for eternity. Can we handle it in a more sustainable and user-friendly way? |
When sending a message (messages 4,5,6) when offline (optimistically) the messages do not appear before a different message (that was sent by another user when online). Although they were sent optimistically before that "new message" message was sent. I expected that the messages (4,5,6) that were sent offline would appear in their respective location (before the message that was sent by the other user "New message"). This can be confusing to some people. @vishalnarkhede can you check how other SDKs have implemented this? Screen.Recording.2022-11-02.at.10.52.41_compressed.mp4 |
When sending a message offline, the exclamation mark sometimes appears and in some cases, it doesn't can we be more consistent about it? To reproduce send messages from both devices when offline, it happened mainly on android for me |
hmm good point. I think its best to simply not allow sending a giphy while offline |
This is a technical limitation for us from backend side. We don't allow inserting the messages before latest message |
ff5e5f5
to
83278b6
Compare
SonarCloud Quality Gate failed. |
54d5497
to
065ef21
Compare
76188d9
to
3323320
Compare
… the app in offline mode
bfe74b6
to
daba536
Compare
…act-native into feat/optimistic-db-updates
…act-native into feat/optimistic-db-updates
SonarCloud Quality Gate failed. |
🎉 This PR is included in version 5.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎯 Goal
Implements #1709
Fixes #1773
🛠 Implementation details
sendReaction
,deleteReaction
anddeleteMessage
functions within Channel component, which will be passed down through context. These functions are responsible for optimistically updating the reaction or adding a new message to local state and DB.DBSyncManager
which is responsible for all the tasks regarding syncing channel states within local DB e.g., calling sync api and executing pending tasks etc.How it works
pendingTasks
tablependingTasks
table.It works the same way for new messages or deleted messages
connection.changed
event withonline
value astrue
🎨 UI Changes
iOS
Android
🧪 Testing
☑️ Checklist
develop
branch