Skip to content

fix(upload): fix download() locks main thread on Android #2838

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

Merged
merged 8 commits into from
Jul 18, 2025

Conversation

velocitysystems
Copy link
Contributor

@velocitysystems velocitysystems commented Jul 11, 2025

Fixed:
#2593

Key Changes

  • Add Upload demo to example project
  • Add tests for upload method
  • Use Tokio to spawn task when invoking download or upload command
  • Fix bug where upload progress not properly reported from file_to_body function

Screenshots
image

Screenshot_1752595073

Copy link
Contributor

github-actions bot commented Jul 11, 2025

Package Changes Through 9549d50

There are 8 changes which include barcode-scanner with minor, barcode-scanner-js with minor, upload with patch, upload-js with patch, window-state with minor, window-state-js with minor, fs with patch, fs-js with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.30 2.0.31
api-example-js 2.0.26 2.0.27
barcode-scanner 2.3.0 2.4.0
barcode-scanner-js 2.3.0 2.4.0
fs 2.4.0 2.4.1
fs-js 2.4.0 2.4.1
dialog 2.3.0 2.3.1
dialog-js 2.3.0 2.3.1
http 2.5.0 2.5.1
http-js 2.5.0 2.5.1
persisted-scope 2.3.0 2.3.1
upload 2.3.0 2.3.1
upload-js 2.3.0 2.3.1
window-state 2.3.0 2.4.0
window-state-js 2.3.0 2.4.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@velocitysystems velocitysystems force-pushed the bug/2393_ui_thread_locking branch 2 times, most recently from 3d030df to 578625a Compare July 15, 2025 16:01
@velocitysystems
Copy link
Contributor Author

velocitysystems commented Jul 15, 2025

Tested upload demo on the following platforms:

  • macOS
  • Windows^
  • Android (emulator)
  • iOS (simulator)

Verified no locking of the main (UI) thread occurs when downloading or uploading.

^ When testing on Windows, I ran into the issues described in #2852. Switching to the Brownfield pattern in a local branch allowed me to test and validate the behavior was correct.

@velocitysystems velocitysystems marked this pull request as ready for review July 15, 2025 16:17
@velocitysystems velocitysystems requested a review from a team as a code owner July 15, 2025 16:17
@velocitysystems
Copy link
Contributor Author

@lucasfernog Fixed this issue.

FYI - I noticed mobile support isn't added in the example project; I had to manually run tauri ios init and tauri android init. Should this be included in another PR? I wasn't sure if there was a compelling reason why this isn't included.

@velocitysystems
Copy link
Contributor Author

Added tests for upload method.

Copy link
Member

@FabianLars FabianLars left a comment

Choose a reason for hiding this comment

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

thanks for the pr just a nitpick annotated and we'll also need a changefile :) (check .changes dir for examples)

@velocitysystems velocitysystems force-pushed the bug/2393_ui_thread_locking branch from 8fb9ad0 to 667a0d2 Compare July 18, 2025 11:28
@velocitysystems
Copy link
Contributor Author

thanks for the pr just a nitpick annotated and we'll also need a changefile :) (check .changes dir for examples)

Thanks for the review @FabianLars! Just pushed a commit to resolve your comments.

@velocitysystems velocitysystems force-pushed the bug/2393_ui_thread_locking branch from f93d2d5 to 2cd12e4 Compare July 18, 2025 13:02
Copy link
Member

@FabianLars FabianLars left a comment

Choose a reason for hiding this comment

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

thanks :)

@FabianLars FabianLars merged commit b729203 into tauri-apps:v2 Jul 18, 2025
173 checks passed
@velocitysystems velocitysystems deleted the bug/2393_ui_thread_locking branch July 18, 2025 20:20
@lucasfernog
Copy link
Member

amazing PR!

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

Successfully merging this pull request may close these issues.

3 participants