immich icon indicating copy to clipboard operation
immich copied to clipboard

[BUG] Infinitely Growing div during multi-file downloads

Open wittymap opened this issue 2 years ago • 11 comments

The bug

When downloading a lot of photos from the web client, the status dialog overflows (I'm downloading 2000 files now): image

In the inspector, the width of this div is ever-expanding (the % is rapidly increasing as I watch it). firefox_lz6l148H5z

aYQ6f1MVhe

The OS that Immich Server is running on

Windows 10

Version of Immich Server

v1.60.0

Platform with the issue

  • [ ] Server
  • [X] Web
  • [ ] Mobile

wittymap avatar Jun 10 '23 16:06 wittymap

Can you describe how are you downloading a lot of files to help us reproduce this issue?

alextran1502 avatar Jun 10 '23 16:06 alextran1502

Gif added above to show ever-expanding div.

From the timeline, I am selecting all files from a date (~2000 in this case), and then clicking the download button on the 3-dots menu in the upper right of a corner.

Does this help?

wittymap avatar Jun 10 '23 16:06 wittymap

Since we have multiple ways of selecting and downloading files. I need to know the exact steps you performed to reproduce the issue

alextran1502 avatar Jun 10 '23 16:06 alextran1502

I refreshed the timeline page (/photos) to start from scratch. Browser is Firefox.

Then I selected all of the files from a date by clicking the date (: image

Then I clicked download from the 3-dots menu: image

Then the dialog appeared and stayed like this at 0% for about a minute: image

Then the progress bar started moving and the bug happens: image

Eventually, the progress bar disappears and the files download successfully as a large zip.

Does this help?

wittymap avatar Jun 10 '23 16:06 wittymap

Thank you for the report. Does it happen with 1 file selected for download, how many files did you choose for this to happen?

alextran1502 avatar Jun 10 '23 17:06 alextran1502

The original report was with 2129 files selected. I've been able to reproduce it on as few as 2 files (but not 1).

It does not happen with all photos and videos, and seems to affect motion photos most often (it has affected every motion photo I have tried it on). With the same two files, the behavior is the same every time.

No errors show up in the server logs.

wittymap avatar Jun 10 '23 18:06 wittymap

hello, i am having the same issue, see attached image.

immich_bug

after some experimentation it seems to me as well that the problem only (or most frequently) occurs with motion photos, even when just selecting one motion photo. I am running v1.61.0

maybe the file size (and therefore progress indicator) is not calculated correctly for motion photos?

ckhordiasma avatar Jun 16 '23 16:06 ckhordiasma

This is probably because e.lengthComputable is not check here:

https://github.com/immich-app/immich/blob/f04e47803c3eb5b0d7b0bf7fc5c0a12fc74e7931/web/src/lib/utils/asset-utils.ts#L52

uhthomas avatar Jun 16 '23 19:06 uhthomas

Hmm, maybe not. It looks like lengthComputable is always false because Immich isn't setting a Content-Length header (why?). I'll take a closer look.

uhthomas avatar Jun 16 '23 19:06 uhthomas

here's a sample motion image (i guess it gets split into a heic and a mov) that causes the error for me. immich.zip

ckhordiasma avatar Jun 16 '23 20:06 ckhordiasma

fwiw I can reproduce this with motion photos on v1.57.1, I can't on v1.61.0 though.

image

uhthomas avatar Jun 16 '23 21:06 uhthomas