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

fix: self-deleting asset message timer [WPB-1807] #3465

Merged

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented Sep 24, 2024

StoryWPB-1807 Self-deleting: Delete assets from internal storage once the timer runs out


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

For self-deleting message with asset, the timer doesn't start counting down until the user opens the asset.

Causes (Optional)

We had mixed old and new logic when it comes to starting the countdown. First we implemented self-deleting messages with asset in a way that it only starts counting down when the user actually opens the asset. It was changed some time ago to unify it with other platforms, so now it should start counting down at the moment the message is shown to the user, no matter if the user actually opens the asset or not. The problem is that part of the old logic was still in the code and because of that the timer was not being shown until the user opened the asset.

Solutions

Show the timer at the moment the message is being shown on the screen, so the logic is now the same for all types of self-deleting messages, no matter what content it has and no matter if the content has actually been opened or not.
Also, it includes new changes regarding deleting asset files when self-deleting message disappears (wireapp/kalium#3027).

Dependencies (Optional)

Needs releases with:

Testing

How to Test

Send a self-deleting message with asset and check if the timer is clearly visible from the first moment the message appeared on the screen.

Attachments (Optional)

Before After
self-deleting-remove-asset-before.mov
self-deleting-remove-asset-after.mov

PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@echoes-hq echoes-hq bot added the echoes: features End-user visible changes intended to create customer value label Sep 24, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 44.73%. Comparing base (7c0cc88) to head (c970b4f).
Report is 2 commits behind head on release/candidate.

Files with missing lines Patch % Lines
...android/ui/home/conversations/MessageExpiration.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           release/candidate    #3465   +/-   ##
==================================================
  Coverage              44.73%   44.73%           
==================================================
  Files                    456      456           
  Lines                  15454    15454           
  Branches                2584     2584           
==================================================
  Hits                    6914     6914           
  Misses                  7810     7810           
  Partials                 730      730           
Files with missing lines Coverage Δ
.../conversations/messages/item/RegularMessageItem.kt 0.00% <ø> (ø)
...android/ui/home/conversations/MessageExpiration.kt 52.94% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c0cc88...c970b4f. Read the comment docs.

Copy link
Contributor

Built wire-android-staging-compat-pr-3465.apk is available for download

@saleniuk saleniuk requested review from a team, borichellow, MohamadJaara, vitorhugods, mchenani and mathias-niboulies and removed request for a team September 25, 2024 07:04
Copy link
Contributor

@borichellow borichellow left a comment

Choose a reason for hiding this comment

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

We apply the same delete logic to all messages.
What if delete timer is 1m and there is 2 minutes audio message??? User has no chance to listen the whole message ;P

@saleniuk
Copy link
Contributor Author

We apply the same delete logic to all messages. What if delete timer is 1m and there is 2 minutes audio message??? User has no chance to listen the whole message ;P

It's the sender who decides to send a 2m long audio message knowing that he sends it as a 1m self-deleting message, it's not the app's fault 😄
With this PR we just fully unified our logic to work the same as on iOS and web, moreover, it's been like that for a few months now with only difference that the timer visibility was broken 🙃

…into fix/self-deleting-asset-msg-timer-start
Copy link

sonarcloud bot commented Sep 25, 2024

Copy link
Contributor

Built wire-android-staging-compat-pr-3465.apk is available for download

@MohamadJaara MohamadJaara added this pull request to the merge queue Sep 25, 2024
Merged via the queue into release/candidate with commit 9d2d0f4 Sep 25, 2024
14 checks passed
@MohamadJaara MohamadJaara deleted the fix/self-deleting-asset-msg-timer-start branch September 25, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: features End-user visible changes intended to create customer value size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants