Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(mobile): improve downloading algorithm for sharing#27312

Merged
shenlong-tanwen merged 7 commits into
mainfrom
feat/share-downloading
May 27, 2026
Merged

feat(mobile): improve downloading algorithm for sharing#27312
shenlong-tanwen merged 7 commits into
mainfrom
feat/share-downloading

Conversation

@YarosMallorca

Copy link
Copy Markdown
Collaborator

Description

Significantly improves the "share" behavior for remote assets.
Adds a linear progress indicator & percentage for the "preparing" screen.

Uses the same scheme as for the regular "download" action, using background_downloader.
This improves download time dramatically for the "share" function specifically.

How Has This Been Tested?

  • Tested on Android Emulator
  • Untested on iOS

Video demo

sharing-download.mp4

@LeLunZ

LeLunZ commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

Tested on iOS simulator also works there.

I also noticed that sometimes pressing share takes forever.
I just tested a 100Mb download, and it takes 6 seconds with this PR and 10 seconds on main. I ran this a few times with similar timing results.

Actually not sure what's causing the difference. Really intresting

@YarosMallorca

Copy link
Copy Markdown
Collaborator Author

I'll have to test it more extensively on iOS to figure out why it takes forever to load sometimes, on Android that didn't happen to me.
It's probably faster because it's using a background thread instead of the main process.

@lukaszwawrzyk

Copy link
Copy Markdown
Contributor

I am hoping that this PR could help with my issue, where if I try to share a photo and I am not in my home network (though I have a good connection) it takes forever or fails. It happens on both ios and android for me.

final taskId = 'share-$remoteId-${DateTime.now().microsecondsSinceEpoch}';
final sanitizedFilename = asset.name.replaceAll(RegExp(r'[\\/]'), '_');
final task = DownloadTask(
taskId: taskId,

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.

Maybe add a share download group ID? The existing downloads use a separate ID so this won't pollute the queue, but it is still a good idea to group these with a different ID.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done. Please test on iOS before merging.

@immich-push-o-matic

immich-push-o-matic Bot commented May 20, 2026

Copy link
Copy Markdown

📱 Android release APK (universal)d1bb3d1639f9f4d19064a03171fb0b7c878cb806

Download: https://github.com/immich-app/immich/actions/runs/26525569825/artifacts/7246639403

QR code QR code

Installs as a separate app (applicationId app.alextran.immich.pr27312), so it coexists with the Play Store version and any other PR builds.

@shenlong-tanwen shenlong-tanwen enabled auto-merge (squash) May 27, 2026 16:51
@shenlong-tanwen shenlong-tanwen merged commit 936c28a into main May 27, 2026
52 checks passed
@shenlong-tanwen shenlong-tanwen deleted the feat/share-downloading branch May 27, 2026 17:00
knom pushed a commit to knom/immich that referenced this pull request May 31, 2026
…7312)

* feat(mobile): better downloading while sharing

* chore: separate download group

---------

Co-authored-by: shenlong-tanwen <[email protected]>
@vanaya2002

Copy link
Copy Markdown

Hi all, new here but I'm hitting what looks like this issue on iOS. Sharing a photo via "Create link" → Messages shows a "Preparing..." message that flashes and disappears almost instantly — the share never completes.

Environment:

  • Server: v2.7.5
  • App: v2.7.5 (build 256)
  • Device: iPhone 12, iOS 26.5

This used to work a few weeks ago, so it may have regressed around the same area this PR touches. Noting that the PR description mentions it was untested on iOS — wanted to flag that it doesn't seem to fully resolve the problem there yet, unless I'm hitting something separate.

@YarosMallorca

YarosMallorca commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator Author

@vanaya2002 Please raise an issue describing the problem. Mention that it is potentially linked/caused by this PR, although unconfirmed.

Missed that you mentioned v2.7.5. This PR is not part of that version, so it is NOT caused by this change.

@LeLunZ LeLunZ mentioned this pull request Jun 20, 2026
4 tasks
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