Skip to content

Conversation

@sbakhtiarov
Copy link
Contributor

@sbakhtiarov sbakhtiarov commented Oct 17, 2025

BugWPB-20906 [Android] Uploading a big asset and sending the app to the background cancels the upload and sending failing

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

What's new in this PR?

  • New ObserveAssetUploadStateUseCase use case for observing upload state
  • Refactoring of the ScheduleNewAssetMessageUseCase
    • Extracting persist and upload logic into separate use cases
    • Using data class for passing asset data to avoid long parameter lists

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2025

Test Results

0 tests   - 4 050   0 ✅  - 3 939   0s ⏱️ - 5m 56s
0 suites  -   684   0 💤  -   111 
0 files    -   684   0 ❌ ±    0 

Results for commit 76bb02c. ± Comparison against base commit 48d592d.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2025

Codecov Report

❌ Patch coverage is 45.10638% with 129 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.41%. Comparing base (48d592d) to head (76bb02c).

Files with missing lines Patch % Lines
...ture/asset/upload/PersistNewAssetMessageUseCase.kt 0.00% 36 Missing ⚠️
...feature/asset/upload/UploadAssetMessageMetadata.kt 58.13% 16 Missing and 2 partials ⚠️
.../wire/kalium/logic/feature/message/MessageScope.kt 0.00% 18 Missing ⚠️
...ure/asset/upload/ScheduleNewAssetMessageUseCase.kt 73.43% 12 Missing and 5 partials ⚠️
...ic/feature/asset/ObserveAssetUploadStateUseCase.kt 0.00% 16 Missing ⚠️
...gic/feature/message/SendMultipartMessageUseCase.kt 0.00% 9 Missing ⚠️
...ium/cells/data/MessageAttachmentDraftDataSource.kt 0.00% 4 Missing ⚠️
...e/kalium/persistence/dao/message/MessageDAOImpl.kt 0.00% 4 Missing ⚠️
...ire/kalium/logic/data/message/MessageRepository.kt 0.00% 3 Missing ⚠️
...m/logic/feature/asset/upload/UploadAssetUseCase.kt 91.42% 3 Missing ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3669      +/-   ##
===========================================
- Coverage    57.58%   57.41%   -0.17%     
===========================================
  Files         1781     1785       +4     
  Lines        59263    59344      +81     
  Branches      5770     5775       +5     
===========================================
- Hits         34125    34071      -54     
- Misses       22711    22850     +139     
+ Partials      2427     2423       -4     
Files with missing lines Coverage Δ
...m/cells/domain/MessageAttachmentDraftRepository.kt 100.00% <ø> (ø)
...om/wire/kalium/logic/data/asset/AssetRepository.kt 89.44% <100.00%> (-0.07%) ⬇️
.../wire/kalium/persistence/dao/message/MessageDAO.kt 100.00% <ø> (ø)
...messageattachment/MessageAttachmentDraftDaoImpl.kt 0.00% <0.00%> (ø)
...ire/kalium/logic/data/message/MessageRepository.kt 52.75% <0.00%> (-0.64%) ⬇️
...m/logic/feature/asset/upload/UploadAssetUseCase.kt 91.42% <91.42%> (ø)
...ium/cells/data/MessageAttachmentDraftDataSource.kt 0.00% <0.00%> (ø)
...e/kalium/persistence/dao/message/MessageDAOImpl.kt 71.81% <0.00%> (-0.98%) ⬇️
...gic/feature/message/SendMultipartMessageUseCase.kt 0.00% <0.00%> (ø)
...ic/feature/asset/ObserveAssetUploadStateUseCase.kt 0.00% <0.00%> (ø)
... and 4 more

... and 4 files with indirect coverage changes


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 48d592d...76bb02c. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2025

🐰 Bencher Report

Branchfeat/background-upload
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymicroseconds (µs)
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInFiles📈 view plot
⚠️ NO THRESHOLD
689.04 µs
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory📈 view plot
⚠️ NO THRESHOLD
337,056.81 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark📈 view plot
⚠️ NO THRESHOLD
1,476,879.55 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark📈 view plot
⚠️ NO THRESHOLD
28,813.89 µs
🐰 View full continuous benchmarking report in Bencher

@sbakhtiarov sbakhtiarov force-pushed the feat/background-upload branch from 97cf37b to 100ac86 Compare October 22, 2025 15:19
@sbakhtiarov sbakhtiarov marked this pull request as ready for review October 27, 2025 13:38
@sbakhtiarov sbakhtiarov enabled auto-merge November 5, 2025 14:09
@sbakhtiarov sbakhtiarov force-pushed the feat/background-upload branch from 7b8b45a to 2777e3c Compare November 5, 2025 14:44
@sbakhtiarov sbakhtiarov force-pushed the feat/background-upload branch from 2777e3c to 76bb02c Compare November 5, 2025 15:00
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 5, 2025

@sbakhtiarov sbakhtiarov added this pull request to the merge queue Nov 5, 2025
Merged via the queue into develop with commit 41d4401 Nov 5, 2025
24 checks passed
@sbakhtiarov sbakhtiarov deleted the feat/background-upload branch November 5, 2025 16:01
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.

5 participants