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: images stuck in upload in progress state #39923

Open
delowardev opened this issue Mar 31, 2022 · 3 comments
Open

Gallery: images stuck in upload in progress state #39923

delowardev opened this issue Mar 31, 2022 · 3 comments
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Feature] Media Anything that impacts the experience of managing media [Type] Bug An existing feature does not function as intended

Comments

@delowardev
Copy link
Contributor

delowardev commented Mar 31, 2022

Description

If someone presses the 'Save' button while the gallery block is uploading images, images get stuck in the loading state.

Please check the attached video: https://share.vidyard.com/watch/zZ3dZUQVofCkPziqYa4kTg

Step-by-step reproduction instructions

  1. Create a gallery block
  2. Drop some images
  3. Press the 'Save/Update' button while images are uploading.
  4. Reload the browser window

Screenshots, screen recording, code snippet

Screenshot:
Screen Shot 2022-03-31 at 10 25 33 AM

Environment info

  • Gutenberg: 12.9.0
  • WordPress: 5.9
  • Browser: Chrome

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@Mamaduka
Copy link
Member

Related #16030.

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Feature] Media Anything that impacts the experience of managing media [Block] Gallery Affects the Gallery Block - used to display groups of images labels Mar 31, 2022
@noisysocks
Copy link
Member

This and the related issues have been a longstanding problem to do with using setAttributes( { image: null } ) as how we indicate that the image is uploading. We ought to use useState() and then only call setAttributes once when the image is uploaded.

@Mamaduka
Copy link
Member

The image block uses state while image is blob.

if ( isBlobURL( media.url ) ) {
setTemporaryURL( media.url );
return;
}

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 [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants