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

feat: support for local assets preview (#WPB-15738) #3308

Open
wants to merge 1 commit into
base: epic/wire-cells
Choose a base branch
from

Conversation

sbakhtiarov
Copy link
Contributor

@sbakhtiarov sbakhtiarov commented Feb 25, 2025

TaskWPB-15738 [Android] Video preview

https://wearezeta.atlassian.net/browse/WPB-15738
https://wearezeta.atlassian.net/browse/WPB-15736

PR Submission Checklist for internal contributors

What's new in this PR?

Support for rendering assets preview after downloading / decrypting. To show local preview user needs to download and decrypt the asset file.

  • Added LocalData field to asset data to have a reference to local file for the asset. This file is used for rendering video / pdf previews.
  • Added local data path to the MessageDetailsView to return it with the messages query from the database.
  • SendTextMessageUseCase removed test code for sending multiple attachments.

Copy link
Contributor

github-actions bot commented Feb 25, 2025

Test Results

316 tests   307 ✅  39s ⏱️
  6 suites    9 💤
  6 files      0 ❌

Results for commit 054ff0c.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

Datadog Report

Branch report: video-preview-support
Commit report: 1df86d5
Test service: kalium-jvm

✅ 0 Failed, 1 Passed, 0 Skipped, 0s Total Time

@@ -148,6 +149,7 @@ FROM Message
JOIN UserDetails ON Message.sender_user_id = UserDetails.qualified_id
LEFT JOIN MessageTextContent AS TextContent ON Message.id = TextContent.message_id AND Message.conversation_id = TextContent.conversation_id
LEFT JOIN MessageAssetContent AS AssetContent ON Message.id = AssetContent.message_id AND Message.conversation_id = AssetContent.conversation_id
LEFT JOIN Asset AS AssetData ON AssetContent.asset_id = AssetData.key
Copy link
Member

Choose a reason for hiding this comment

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

instead of storing path within DB does it make sense to have a fixed path
something like
/appData/files/{conversaion_id}/{file_type}/{asset_key}
this way we can avid this left join and we can always get the correct path ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, but we are not just storing the path, we are also observing the path changes. So when the app downloads and decrypts the asset the path is updated and UI can immediately use it to show the preview.
The only way to do it with the fixed paths is to set up file observer for the /appData/files/ folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants