web-stories-wp: Story saved pointing to "blob" URL, causing video to fail loading in story

Bug Description

For this story the background video in page one was saved using an incorrect blob url. Per @swissspidy 's review this is the markup: <amp-video autoPlay="autoplay" poster="blob:https://stories-new-wordpress-amp.pantheonsite.io/13a6604b-2b51-4a6e-b4e6-7d0eceec4bf4" artwork="blob:https://stories-new-wordpress-amp.pantheonsite.io/13a6604b-2b51-4a6e-b4e6-7d0eceec4bf4" title="Bridge In Place" alt="Bridge In Place" layout="fill" id="el-5aff6cbd-9252-4e9d-a532-969cbde98f1a-media"><source type="video/mp4" src="blob:https://stories-new-wordpress-amp.pantheonsite.io/491491bd-b975-46b1-b337-5561e134bdce"/></amp-video>

Also from Pascal: “See the blob: thing. That means the video & images were probably still uploading at the time the story was saved, Of course a blob: URL isn’t really valid, hence the video fails to play”

Expected Behaviour

Story should be saved with the proper video URL, no blobs.

Steps to Reproduce

  1. Drag a video onto canvas to upload while creating story
  2. While video is uploading, save story/autosave?

Screenshots

Additional Context

  • Plugin Version:
  • Operating System:
  • Browser:

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance Criteria

Implementation Brief

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

@miina testing main branch, hasNewChanges is true after I select something.

Hmm, okay, this seems to happen only in case of Media – looks like selecting media is creating a new history entry for some reason (hasNewChanges is tracking new history entries compared to the saved version) – e.g. you can see the Undo becoming active as well. Looks like there’s something updating Media when selecting it even though nothing is actually changing, seems like a regression/bug indeed.

Edit: we should create a bug issue for “Selecting Media creates a new history entry” or sth similar.

@swissspidy @miina Disabling Preview (and maybe Save) until upload is done is a good idea. But we also need to disable auto-save, right?

Here’s another story where I can seem to repro (see page two here)

I repro’d by just creating a story and saving/previewing while I was working and dragging video to the canvas to upload and use in the story. Unsure of the specific steps that led to the broken video in page 2, but not in page 1, but I reproduced the issue quickly.