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

Only save Draft when adding Attachment #1832

Merged
merged 3 commits into from
May 1, 2024

Conversation

KevinBoulongne
Copy link
Contributor

@KevinBoulongne KevinBoulongne commented Apr 29, 2024

We were saving Draft everytime we add or remove an Attachment, it's too much.
Now, we only save Draft when adding an Attachment.

Also, if we add a lot of Attachments at the same time (via the FilePicker), and we delete them all while it's still saving, the DraftsActionsWorker will fail because it's won't find the files on the phone disk.
Now, it will just ignore these failures so the Draft can be saved.

Copy link
Contributor

@FabianDevel FabianDevel left a comment

Choose a reason for hiding this comment

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

This display a toast (should be a snackbar I think as we stay in the app) when coming b ack to the activity after saving an attachment
This is annoying as we are already displaying a toast when quitting the activity to open the picker
We probably shouldn't display anything when coming back to the activity

EDIT: it will be done, but in another PR

@KevinBoulongne KevinBoulongne marked this pull request as draft May 1, 2024 08:21
auto-merge was automatically disabled May 1, 2024 08:21

Pull request was converted to draft

@KevinBoulongne KevinBoulongne force-pushed the too-much-draft-saving branch 2 times, most recently from ab72feb to 0b1c0bc Compare May 1, 2024 08:29
@KevinBoulongne KevinBoulongne changed the base branch from draft-revamp to memory-leak May 1, 2024 08:31
@KevinBoulongne KevinBoulongne marked this pull request as ready for review May 1, 2024 08:31
@github-actions github-actions bot added the dependent This MR depends on another PR label May 1, 2024
@KevinBoulongne KevinBoulongne changed the base branch from memory-leak to draft-revamp May 1, 2024 12:26
@github-actions github-actions bot removed the dependent This MR depends on another PR label May 1, 2024
@KevinBoulongne KevinBoulongne merged commit 3962e4e into draft-revamp May 1, 2024
7 checks passed
@KevinBoulongne KevinBoulongne deleted the too-much-draft-saving branch May 1, 2024 12:41
Copy link

sonarcloud bot commented May 1, 2024

Please retry analysis of this Pull-Request directly on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Improve the performance or efficiency of the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants