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

If a more recent revision/autosave exists, store its state on editor setup #7945

Merged
merged 22 commits into from
Apr 18, 2019

Conversation

talldan
Copy link
Contributor

@talldan talldan commented Jul 13, 2018

closes #7416

Attempts to resolve an issue whereby the editor is unaware of the existence of
a more recent autosave, resulting in attempts to perform an autosave fail.

Description

This PR results in autosave state being fetched when the editor loads (via a resolver). This request is preloaded (will require a core patch). Changes include:

  • Migration of autosave state from '@wordpress/editor' to '@wordpress/core-data'.
  • Addition of resolver for 'getAutosave' selector.
  • Disabling of the preview button until autosave state is fetched.
  • Deprecation of old selectors/actions

How has this been tested?

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@talldan talldan added [Type] Bug An existing feature does not function as intended [Feature] Saving Related to saving functionality labels Jul 13, 2018
@talldan talldan self-assigned this Jul 13, 2018
@talldan talldan requested a review from aduth July 13, 2018 05:06
lib/client-assets.php Outdated Show resolved Hide resolved
@talldan talldan force-pushed the fix/initial-autosave-state branch from 73ed574 to 4c32e56 Compare July 20, 2018 06:15
@talldan

This comment has been minimized.

@talldan talldan force-pushed the fix/initial-autosave-state branch 2 times, most recently from f5f49f9 to 27b921b Compare July 23, 2018 05:08
@youknowriad
Copy link
Contributor

This seems an important bug to fix, but I'm moving to 3.8 for now as it doesn't seem ready.

@talldan talldan force-pushed the fix/initial-autosave-state branch 2 times, most recently from 40cb6ab to 847c699 Compare September 4, 2018 08:38
@talldan talldan added the [Status] In Progress Tracking issues with work in progress label Sep 6, 2018
@talldan talldan force-pushed the fix/initial-autosave-state branch 2 times, most recently from 68791dd to 2af62da Compare September 7, 2018 14:21
@talldan

This comment has been minimized.

@talldan

This comment has been minimized.

@talldan talldan force-pushed the fix/initial-autosave-state branch 2 times, most recently from 53a19b0 to 9e1a31b Compare September 25, 2018 17:49
@talldan

This comment has been minimized.

@talldan talldan added Needs Technical Feedback Needs testing from a developer perspective. and removed [Status] In Progress Tracking issues with work in progress labels Oct 11, 2018
@aduth
Copy link
Member

aduth commented Nov 8, 2018

There's quite a bit which has since been changed in affected code here, for which I'm largely to blame (both for the changes and neglecting to review this sooner). Let me know if there's anything I can do to help with bringing this back up to date.

@talldan
Copy link
Contributor Author

talldan commented Nov 12, 2018

@aduth - I've rebased it. I ended up dropping a couple of commits that didn't seem relevant any more. They seem to have been fixed since.

My understanding is that if we want to introduce this, the PHP code will need to patched into core. Is that right?

@aduth
Copy link
Member

aduth commented Nov 12, 2018

Yes, and there may be some conflict to anticipate between this and the changes introduced to core as part of Trac#45194 (specifically 43833), which doesn't appear to have yet been ported back to the plugin (cc @imath @danielbachhuber).

@aduth aduth added the REST API Interaction Related to REST API label Nov 12, 2018
@danielbachhuber
Copy link
Member

the changes introduced to core as part of Trac#45194 (specifically 43833), which doesn't appear to have yet been ported back to the plugin

It's still a WIP on #4155

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Saving Related to saving functionality REST API Interaction Related to REST API [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saving: Autosaveable does not account for autosave existing at start of editing
8 participants