Skip to content
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

Enable deleting messages in pendingSend state #2432

Merged
merged 4 commits into from
Jan 4, 2023

Conversation

martinmitrevski
Copy link
Contributor

🔗 Issue Links

GH

Follow-up ticked should be created to improve the experience in the UIKit SDK.

🎯 Goal

We need to be able to delete messages in pendingSend state. If a message doesn't change it's state while it's being sent (e.g. kill the app while uploading a video), you can't do any action with it - it just stays in pendingSend.

The goal of the PR is to allow such messages to be deleted.

🛠 Implementation

Updated the logic in the MessageUpdater's deleteMessage to allow deleting only local messages when the state is pendingSend.

🎨 Showcase

No visual changes.

Before After
img img

🧪 Manual Testing Notes

Open the SwiftUI app. Add a video, and while uploading, kill the app. You should be able to delete this message when you come back (previously it was not possible).

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change follows zero ⚠️ policy (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Comparison screenshots added for visual changes
  • Affected documentation updated (docusaurus, tutorial, CMS)

🎁 Meme

Alt Text

@martinmitrevski martinmitrevski requested a review from a team as a code owner January 4, 2023 09:39
@github-actions
Copy link

github-actions bot commented Jan 4, 2023

1 Warning
⚠️ Please be sure to complete the Contributor Checklist in the Pull Request description

Generated by 🚫 Danger

@emerge-tools
Copy link

emerge-tools bot commented Jan 4, 2023

📏 Size Analysis

Total install size 10.6 MB | This change: ⬆️ +178.8 kB (+1.71%)

Image of diff

🗂 See size breakdown
Item Install size
ChatSample/Strings.CFStrings 🔺 12.4 kB
ChatSample/External Methods 🔺 8.3 kB
➕ ChatSample/SentryProfiler.captureEnvelope 🔺 7.5 kB
ChatSample/Strings.Unmapped 🔺 5.1 kB
➖ ChatSample/SentryTraceState ⬇️ 4.0 kB
ChatSample/Code Signature 🔺 3.8 kB
➕ ChatSample/SentryNetworkTracker.captureFailedRequests: 🔺 3.2 kB
➖ ChatSample/SentryProfiler.buildEnvelopeItemForTransaction: ⬇️ 2.7 kB
➕ ChatSample/CL.CLLocationManagerDelegate.Objc Metadata 🔺 2.4 kB
➕ ChatSample/SentryFileManager.initWithOptions:andCurrentDateProvider:dispatchQueueWrapper:error: 🔺 2.3 kB
➖ ChatSample/SentryCrashDeadlockMonitor ⬇️ 1.9 kB
➕ ChatSample/processBacktrace 🔺 1.8 kB
ChatSample/SentryNetworkTracker.urlSessionTaskResume: 🔺 1.8 kB
ChatSample/DYLD.Exports 🔺 1.7 kB
➕ ChatSample/SentryUIViewControllerSwizzling.swizzleUIViewControllersOfClassesInImageOf: 🔺 1.6 kB
ChatSample/SentryOptions.Objc Metadata 🔺 1.6 kB
ChatSample/SentryOptions.validateOptions:didFailWithError: 🔺 1.5 kB
ChatSample/SentryFileManager.Objc Metadata 🔺 1.4 kB
➕ ChatSample/SentryTracer.addMeasurements: 🔺 1.4 kB
➕ ChatSample/SentryHttpTransport.initWithOptions:fileManager:requestManager:requestBuilder:rateLimits:envelopeRateLimit:dispatchQueueWrapper:reachability: 🔺 1.3 kB

🔎 See the full size analysis (7dabbba) merging into develop (5d16c7b)

Provide a baseSha and pullRequestNumber with your upload to ensure diffs are correct. Read more in the docs

Copy link
Member

@nuno-vieira nuno-vieira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! ✅ I think we should only make sure we update the changelog 👍

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Nuno Vieira <nuno.fcvieira93@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented Jan 4, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@martinmitrevski martinmitrevski merged commit 7056e8a into develop Jan 4, 2023
@martinmitrevski martinmitrevski deleted the delete-local-message-logic branch January 4, 2023 11:51
@polqf polqf mentioned this pull request Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants