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
Fix messages failing to be deleted when pending updates to the server #2949
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nuno-vieira
added
🐞 Bug
An issue or PR related to a bug
🌐 SDK: StreamChat (LLC)
Tasks related to the StreamChat LLC SDK
labels
Dec 21, 2023
martinmitrevski
approved these changes
Dec 21, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅ Just added one question.
Closed
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 47 New issues |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
🐞 Bug
An issue or PR related to a bug
🌐 SDK: StreamChat (LLC)
Tasks related to the StreamChat LLC SDK
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔗 Issue Links
Resolves https://github.com/GetStream/ios-issues-tracking/issues/685
🎯 Goal
Fix messages failing to be deleted when pending updates to the server.
📝 Summary
🛠 Implementation
The root cause of the problem is that we were incorrectly calculating the logic for
isWaitingToBeSentToTheServer
, which has now been renamed toisLocalOnly
to better describe the goal of the property. Before, if a message was being edited, but not yet published, we would assume it was local only. This is incorrect since the message is already in the server, since it was published once, even tho it does not have the most updated data.While debugging this issue, I also fixed a issue that was happening with background mapping. The issue is similar to this one: #2922. Because the
ChatMessageController.message
is not available on the main thread with background mapping, sometimes it was returningnil
.🧪 Manual Testing Notes
Fix messages failing to be deleted when pending updates to the server:
N/A
Right now this not manually testable in our Demo app, since we do not allow doing any message action while the message is being edited.
Fixes actions not appearing for local-only messages with BG Mapping enabled
☑️ Contributor Checklist