Skip to content

fix(drive): store files in Conversation-scoped directories instead of a flat directory (WPB-27627) - #5139

Open
ohassine wants to merge 10 commits into
developfrom
conversation-scoped-storage-and-stale-file-detection-for-Cells-downloads
Open

fix(drive): store files in Conversation-scoped directories instead of a flat directory (WPB-27627)#5139
ohassine wants to merge 10 commits into
developfrom
conversation-scoped-storage-and-stale-file-detection-for-Cells-downloads

Conversation

@ohassine

@ohassine ohassine commented Aug 6, 2026

Copy link
Copy Markdown
Member

https://wearezeta.atlassian.net/browse/WPB-27627


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

All downloaded Cells files were stored flat in a single directory. Files from different conversations with the same name would collide.

Solutions

  • Conversation-scoped directories — files are now stored under //filename instead of a flat directory, preventing name collisions across conversations. Falls back to the file's own UUID if no conversation ID is available.
  • Removed FileNameResolver, no longer needed; the scoped subdirectory eliminates the need for (1), (2) suffix disambiguation.

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.

…d-storage-and-stale-file-detection-for-Cells-downloads

# Conflicts:
#	kalium
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@ohassine looks like you are rolling back kalium to a previous commitish.

This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.

develop This PR
3787a70e8f2d68b5a03ace5af0c3099ced6e5e06 26a90de96ba916431828c4d4c7aa15719f7924dc

Is this intentional?

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.79%. Comparing base (283d776) to head (ed51e62).

⚠️ Current head ed51e62 differs from pull request most recent head 70e6517

Please upload reports for the commit 70e6517 to get more accurate results.

Files with missing lines Patch % Lines
...com/wire/android/feature/cells/ui/CellViewModel.kt 0.00% 0 Missing and 1 partial ⚠️
...oid/feature/cells/ui/OpenFileDownloadController.kt 75.00% 0 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (77.77%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5139      +/-   ##
===========================================
+ Coverage    52.45%   52.79%   +0.33%     
===========================================
  Files          743      739       -4     
  Lines        25795    25732      -63     
  Branches      4226     4224       -2     
===========================================
+ Hits         13530    13584      +54     
+ Misses       10970    10839     -131     
- Partials      1295     1309      +14     
Files with missing lines Coverage Δ
.../feature/cells/ui/OfflineFileDownloadController.kt 88.60% <100.00%> (+78.60%) ⬆️
...com/wire/android/feature/cells/ui/CellViewModel.kt 48.07% <0.00%> (-0.26%) ⬇️
...oid/feature/cells/ui/OpenFileDownloadController.kt 83.87% <75.00%> (-1.85%) ⬇️

... and 9 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ohassine ohassine changed the title fix: conversation-scoped storage and stale file detection for Cells downloads (WPB-27627) fix(drive): store files in Conversation-scoped directories instead of a flat directory (WPB-27627) Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Test Results

2 648 tests   2 648 ✅  1m 32s ⏱️
  336 suites      0 💤
  336 files        0 ❌

Results for commit ed51e62.

♻️ This comment has been updated with latest results.

@MohamadJaara MohamadJaara left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The Android changes are not part of this ticket.
The ticket is about downloading to a .part file and renaming it only when the download is complete.
This PR changes where files are stored and removes numbered filenames. That is a different problem and should be handled in another ticket or PR.
It may also overwrite files with the same name in one conversation.

@ohassine

Copy link
Copy Markdown
Member Author

The Android changes are not part of this ticket. The ticket is about downloading to a .part file and renaming it only when the download is complete. This PR changes where files are stored and removes numbered filenames. That is a different problem and should be handled in another ticket or PR. It may also overwrite files with the same name in one conversation.

This is part of the fix to avoid filename collisions. Files can't have the same name within a conversation, so storing them under the conversationId allows us to use the original filename without needing numbered filenames

@ohassine
ohassine requested a review from MohamadJaara August 10, 2026 10:48
@github-actions

Copy link
Copy Markdown
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@github-actions

Copy link
Copy Markdown
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@ohassine
ohassine requested review from a team and sbakhtiarov and removed request for a team August 11, 2026 12:58
@sbakhtiarov

sbakhtiarov commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

If I have two folders in one conversation:

Playtest_June/findings.txt
Playtest_July/findings.txt

Will these files collide? As far as I understand now both files will be stored as conversationId/findings.txt

…d-storage-and-stale-file-detection-for-Cells-downloads

# Conflicts:
#	kalium
…d-storage-and-stale-file-detection-for-Cells-downloads

# Conflicts:
#	kalium
@ohassine

ohassine commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

If I have two folders in one conversation:

Playtest_June/findings.txt Playtest_July/findings.txt

Will these files collide? As far as I understand now both files will be stored as conversationId/findings.txt

No, we create the subfolder for each file

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@ohassine
ohassine dismissed MohamadJaara’s stale review September 2, 2026 13:19

Comment addressed

@ohassine
ohassine enabled auto-merge September 2, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants