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

Avoid race conditions between media upload and autosave #5936

Closed
aduth opened this issue Apr 3, 2018 · 10 comments
Closed

Avoid race conditions between media upload and autosave #5936

aduth opened this issue Apr 3, 2018 · 10 comments
Labels
[Feature] Media Anything that impacts the experience of managing media [Feature] Saving Related to saving functionality [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@aduth
Copy link
Member

aduth commented Apr 3, 2018

Related: #4090

An autosave should not take place if there are pending uploads, otherwise the transient media information may be serialized permanently to the post. As in #4090, this was explored as a way to postpone autosave until after blockers have been resolved. This could also be tied into a generalized API for requirements for saves to take place (publish blocking, and related informative UX).

@aduth aduth added the [Type] Task Issues or PRs that have been broken down into an individual action to take label Apr 3, 2018
@danielbachhuber danielbachhuber added this to the WordPress 5.0 milestone May 19, 2018
@mtias mtias added the [Feature] Saving Related to saving functionality label Jul 18, 2018
@mtias mtias added the [Feature] Media Anything that impacts the experience of managing media label Oct 12, 2018
@talldan
Copy link
Contributor

talldan commented Nov 7, 2018

Referencing issue #10158 which I think could be a report of this problem. The user reported the following:

The download link started with blob: (strange protocol)

@aduth
Copy link
Member Author

aduth commented Nov 7, 2018

A more recent approach to save locking (mentioned in the original comment) can be found at #10649, which is now merged.

@mtias mtias added the [Status] In Progress Tracking issues with work in progress label Nov 13, 2018
@noisysocks noisysocks removed the [Status] In Progress Tracking issues with work in progress label Dec 10, 2018
@noisysocks
Copy link
Member

noisysocks commented Dec 10, 2018

What's the status of this?

@talldan
Copy link
Contributor

talldan commented Dec 10, 2018

@noisysocks looks unresolved. Seems as though the work in #10649 could be used in media blocks to fix the issue though.

@aduth
Copy link
Member Author

aduth commented Dec 10, 2018

This is still an issue.

#12724 is a recent effort which includes (working) support to avoid saves whilst an image upload is in progress, but its tandem support for managing undo history of transient states has not yet been settled.

Related: #8119

@paaljoachim
Copy link
Contributor

Is this issue still valid?

@adamsilverstein
Copy link
Member

adamsilverstein commented May 27, 2022

Is this issue still valid?

I think so @paaljoachim - if the post is autosaved while media is in the process of being uploaded, the autosave will contain "corrupted" images that don't work correctly. An ideal solution here would be to prevent autosaving until all uploads have completed.

@adamsilverstein
Copy link
Member

This should be fixed by #41120

@adamsilverstein
Copy link
Member

#41120 locks autosaving during uploads, but isn't a complete solution (see comment on PR)

@youknowriad
Copy link
Contributor

Going to close this one as autosaves and saves can't persist local urls anymore. The remaining work is being tracked in #5936 (blocking saving or triggered unsaved changes)

@youknowriad youknowriad removed this from the WordPress 5.x milestone Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media [Feature] Saving Related to saving functionality [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

8 participants