[FIX] Messages attributed to wrong user
Proposed changes
Under certain circumstances, messages sent by the app user are shown as originating from another user.
Issue(s)
Closes https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/4559
How to test or reproduce
You need two different users.
-
In a desktop browser, open Rocket.Chat and login with one of the users. Navigate to an arbitrary channel.
-
Open the Rocket.Chat app and login with the other user. Navigate to the same channel as in step 1.
-
Submit a message from the app.
-
Prepare another message in the app, but do not submit it right now.
-
Send a message from the desktop browser.
-
Submit the message prepared in step 4. It is important to submit the message before the message from step 5 is displayed in the app.
-
Submit another message from the app.
Screenshots
Before
https://user-images.githubusercontent.com/47038980/194583134-03c87211-b570-4a07-ba15-84a11d9844ba.mov
After
https://user-images.githubusercontent.com/47038980/194583165-20193fcb-614b-41c4-beb1-b3777dfd399f.mov
Types of changes
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] Improvement (non-breaking change which improves a current function)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Documentation update (if none of the other choices apply)
Checklist
- [x] I have read the CONTRIBUTING doc
- [x] I have signed the CLA
- [x] Lint and unit tests pass locally with my changes
- [ ] I have added tests that prove my fix is effective or that my feature works (if applicable)
- [ ] I have added necessary documentation (if applicable)
- [ ] Any dependent changes have been merged and published in downstream modules
Further comments
Jira: TC-160