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: handle the case where asset name can be missing [WPB-10830] #2995

Conversation

MohamadJaara
Copy link
Member


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

  1. iOS does not send asset name when sending images
  2. web sends 2 messages the first one with meta data including name and mimeType, and a second with where to get the asset from

Causes (Optional)

in both cases if asset restriction is on then the message will not be handled correctly and in iOS case it will show prohibated asset, and in web case it will not be visable

Solutions

  1. add fail safe to check mimeType when name is missing, did not cover all cases but the most common mimeType, this should be enugh tho
  2. allow handling of assets with data and no name since it will be handled later in the code by getting the type of the first message

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.

Notes (Optional)

Specify here any other facts that you think are important for this issue.

Attachments (Optional)

Attachments like images, videos, etc. (drag and drop in the text box)


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.

Copy link
Contributor

github-actions bot commented Sep 6, 2024

Test Results

2 931 tests   2 808 ✔️  28s ⏱️
   497 suites     123 💤
   497 files           0

Results for commit 65f5e14.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Sep 6, 2024

Datadog Report

Branch report: fix/Images-and-files-from-same-backend-not-received-in-proteus-conversation
Commit report: 4ccd547
Test service: kalium-jvm

✅ 0 Failed, 2961 Passed, 107 Skipped, 5.96s Total Time

Copy link
Member

@vitorhugods vitorhugods left a comment

Choose a reason for hiding this comment

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

Nicely done. Just one small nit for naming.

Copy link

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 86.79245% with 14 lines in your changes missing coverage. Please review.

Please upload report for BASE (release/android-cycle-4.6@6b3f390). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...m/logic/sync/receiver/asset/AssetMessageHandler.kt 70.00% 7 Missing and 5 partials ⚠️
...lium/logic/feature/asset/GetMessageAssetUseCase.kt 0.00% 0 Missing and 1 partial ⚠️
...ic/feature/asset/ScheduleNewAssetMessageUseCase.kt 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##             release/android-cycle-4.6    #2995   +/-   ##
============================================================
  Coverage                             ?   58.58%           
  Complexity                           ?        7           
============================================================
  Files                                ?     1188           
  Lines                                ?    46952           
  Branches                             ?     4474           
============================================================
  Hits                                 ?    27508           
  Misses                               ?    17452           
  Partials                             ?     1992           
Files with missing lines Coverage Δ
...com/wire/kalium/logic/data/message/AssetContent.kt 45.28% <100.00%> (ø)
...ogic/feature/asset/ValidateAssetFileTypeUseCase.kt 100.00% <100.00%> (ø)
...lium/logic/feature/asset/GetMessageAssetUseCase.kt 80.88% <0.00%> (ø)
...ic/feature/asset/ScheduleNewAssetMessageUseCase.kt 88.82% <75.00%> (ø)
...m/logic/sync/receiver/asset/AssetMessageHandler.kt 78.08% <70.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 6b3f390...65f5e14. Read the comment docs.

@MohamadJaara MohamadJaara merged commit 538bae1 into release/android-cycle-4.6 Sep 10, 2024
19 checks passed
@MohamadJaara MohamadJaara deleted the fix/Images-and-files-from-same-backend-not-received-in-proteus-conversation branch September 10, 2024 15:57
@MohamadJaara MohamadJaara changed the title fix: handle the case where asset name can be missing fix: handle the case where asset name can be missing [WPB-10830] Sep 18, 2024
@echoes-hq echoes-hq bot added the echoes: unplanned Any work item that isn’t part of the product or technical roadmap. label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: unplanned Any work item that isn’t part of the product or technical roadmap. 🚨 Potential breaking changes 👕 size: L type: bug / fix 🐞
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants