Skip to content
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

Gallery-block: adds images even though upload fails #10251

Closed
saulirajala opened this issue Sep 29, 2018 · 3 comments · Fixed by #34371
Closed

Gallery-block: adds images even though upload fails #10251

saulirajala opened this issue Sep 29, 2018 · 3 comments · Fixed by #34371
Assignees
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Feature] Media Anything that impacts the experience of managing media Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@saulirajala
Copy link

Describe the bug
Issue happens when one uploads from computer for example four images: File size of two images are too large, but the other two images are ok. So the result is that two images are uploaded to media library, but two are not.

Yet Gallery -block seems to assume that there are four images in the gallery and "replicates" the two images that were uploaded to media library (see screenshot 1). After reload of the page, gallery-block has two broken images (screenshot 2) and there are errors in console of browser:
GET blob:http://gutenberg.test/88f7c6cd-fe07-475a-8f87-af7bda580c3f net::ERR_FILE_NOT_FOUND
GET blob:http://gutenberg.test/2ce3c7bb-aa28-4187-811e-95e3cbfd3815 net::ERR_FILE_NOT_FOUND

To Reproduce
Steps to reproduce the behavior:

  1. Add Gallery-block
  2. Click Upload -button
  3. Choose two images with too large image size and two ok images
  4. See how gallery "replicates" the images, that were ok
  5. Reload site
  6. Gallery has now two broken images and two ok-images

Expected behavior
Only the images that were actually uploaded to media library, should be added to gallery-block.

Screenshots
Screenshot 1:
nayttokuva 2018-09-29 kello 22 23 39

Screenshot 2:
after_reload

Desktop (please complete the following information):

  • OS: macOS Sierra
  • Browser Chrome
  • Version 69.0.3497.100

Additional context

  • Gutenberg version 3.9.0 (current master)
@designsimply designsimply added [Type] Bug An existing feature does not function as intended [Feature] Media Anything that impacts the experience of managing media Needs Testing Needs further testing to be confirmed. labels Sep 30, 2018
@mtias mtias added [Type] Enhancement A suggestion for improvement. and removed [Type] Bug An existing feature does not function as intended labels Oct 26, 2018
@ellatrix ellatrix added the [Block] Gallery Affects the Gallery Block - used to display groups of images label Jun 24, 2019
@ChrissiePollock
Copy link

ChrissiePollock commented Nov 3, 2019

I tested this in Firefox using a local environment as well as Chrome and Safari. I get the same results in all three browsers.

I downloaded four images from https://unsplash.com/s/photos/large. Their sizes were: 3.1 MB, 2.1 MB, 3.9 MB and 5.6 MB.
bernard-hermant-CLKGGwIBTaY-unsplash
tobias-fischer-ljp-ewA23lc-unsplash
ferdinand-stohr-7F3jUAyqTBg-unsplash
timj-EJ4qfFp1g8Q-unsplash

I did not get the same error message as described in the initial post, but I still had errors.

At first it looked like me images were adding:

Screen%20Shot%202019-11-03%20at%2014 33 18

Then I was shown an error:

Screen%20Shot%202019-11-03%20at%2014 33 53

On Preview, only two images appeared:

Screen%20Shot%202019-11-03%20at%2014 47 21

It was not obvious from the error message that the images were too large.

@mapk mapk removed the Needs Testing Needs further testing to be confirmed. label Nov 19, 2019
@mapk mapk added the [Type] Bug An existing feature does not function as intended label Nov 19, 2019
@mapk mapk removed the [Type] Enhancement A suggestion for improvement. label Dec 28, 2019
@noisysocks noisysocks added the Needs Dev Ready for, and needs developer efforts label Apr 23, 2020
@adamziel
Copy link
Contributor

A similar problem occurs when you save the post while some of the images are still being uploaded.

@aaronrobertshaw
Copy link
Contributor

With all the recent work done around refactoring the Gallery to use nested blocks, now is as good a time as any to see if this is still an issue.

Original gallery

Using the original gallery and setting a 4Mb upload limit, I was not able to replicate the issues described here.

I tried initially with my own images where multiple images were over the limit and some under. Only those under the upload limit were added to the gallery and an error message for the others was displayed. So for me, the original issue described is no longer a problem.

Following that, I tested with the images supplied by @ChrissiePollock. The gallery returned an appropriate error message and only displayed the valid images.

No errors were thrown when attempting to save while images were still uploading either.

At this stage, the original gallery is looking good.

Refactored Gallery (using nested inner image blocks)

After turning on the refactored gallery block experiment and repeating the tests I did experience one problem though.

Screen Shot 2021-08-26 at 5 27 49 pm

There was no error displayed when attempting to upload an image over the size limit. The image block continues to display the loading spinner, as does the gallery's image size control. I left the editor open for several minutes and didn't see any errors or timeout messages appear.

Screen.Recording.2021-08-26.at.5.08.00.pm.mp4

There is a project board tracking issues and follow up tasks for the gallery. I'll add this issue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Feature] Media Anything that impacts the experience of managing media Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants