Fix Cancel ongoing uploading operations after user forcibly cancels the post #2768
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.
Summary
Issue- #2766
Bug scenario- When user presses the Cancel post, all the uploading operations should stop right there but currently the uploading task continues in the background with success urls.
Replication:
Add 5 photos from
MediaPicker
View and press 'Upload'. Then, immediately Cancel the post. Uploading task continues.This PR introduces-
1] Cancel ongoing uploading operations after the user has pressed Cancel post
2] Don't Generate Hepatic Feedback in this error case because user has already dismissed the
PostView
.Testing Performed after the changes made:
1] Add 5 photos from media pickers and press 'Upload'. Then, immediately Cancel the post. No uploading Process takes place [Passed]
2] No
UINotificationFeedbackGenerator()
is triggered [Passed](This change is difficult to demonstrate
on a simulator so there’s no attachment.)
Checklist
Closes:
orFixes:
tags in the commit messages wherever applicable, or made sure those are not needed. See Submitting patchesTest report
Please provide a test report for the changes in this PR. You can use the template below, but feel free to modify it as needed.
Device: [Please specify the device you used for testing]
iOS: [Please specify the iOS version you used for testing]
Damus: [Please specify the Damus version or commit hash you used for testing]
Setup: [Please provide a brief description of the setup you used for testing, if applicable]
Steps: [Please provide a list of steps you took to test the changes in this PR]
Results:
Other notes
[Please provide any other information that you think is relevant to this PR.]