-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Introduce a dedicated autosaves endpoint for handling autosave behavior #6257
Merged
Merged
Changes from 1 commit
Commits
Show all changes
124 commits
Select commit
Hold shift + click to select a range
9b41d7c
autosaves with rest controller, first pass
004c830
use newer title call
9b0a3a4
autosave: compare raw attributes for change check
b4ad672
Clean up autosave effects
aba8548
pull isAutosaving from props in PostSavedState
c6d5cce
Merge branch 'master' of github.com:WordPress/gutenberg
345a508
Merge branch 'master' of github.com:WordPress/gutenberg
bb99f4c
from .14
5e85a53
effects, improve toggle autosave timing, enable autosaving for publis…
491ce55
Disable ‘save draft’ after draft is autosaved
17a67f6
revert post saved state changes, keep save button active regardless o…
81ca0de
remove unrelated showAutosaveAlert
4da3ef1
fixes for eslint
b189a3c
leverage withChangeDetection for autosaves
7769231
Merge branch 'master' into fix/autosaves
d4400a9
fixes for php slint
ab44c63
Merge branch 'master' of github.com:WordPress/gutenberg
5b0e36d
Merge branch 'master' of github.com:WordPress/gutenberg
949557e
Merge branch 'master' into fix/autosaves
e4d20ff
rename WP_REST_Autosaves_Controller -> GB_REST_Autosaves_Controller …
0833e15
Add a docblock for savePost action
6b07e56
check state.autosave exists before using
becb66b
Fix autosave tests
ecc1527
Revert "leverage withChangeDetection for autosaves"
16ce6f1
rename rest controler file to match class passing phplint
124895b
Merge branch 'master' of github.com:WordPress/gutenberg
fd84ca5
Merge branch 'master' into fix/autosaves
dad5683
set up isAutosaving
6c74256
rename controller WP_REST_Autosaves_Controller and only load if class…
5018748
Cleanup doc blocks
93881fc
rename revision_controller -> revisions_controller
5771f51
Merge branch 'master' of github.com:WordPress/gutenberg
7585b00
Merge branch 'master' into fix/autosaves
ed7d553
clean up isAutosaving reducer, removing toggleAutosave action
82a1b16
fixes for php-lint
e02c636
fix test: button stays in saved state when post not dirty
a3c61f7
restore state check
a204ece
Properly instantiate the autosaves controller
danielbachhuber 6c4b7a2
Merge branch 'fix/autosaves' of github.com:WordPress/gutenberg into f…
e5e9e25
ensure isAutosave returns a boolean
7cd9547
Add PHP Unit tests covering WP_REST_Autosaves_Controller functionality
ba0a25f
Avoid duplicate route resgistration
bc79d1f
Rename/fix up unit tests for rest controller
7a9c123
fixes for phpcs
76e6296
Merge branch 'master' into fix/autosaves
5ce9de1
Merge branch 'master' of github.com:WordPress/gutenberg
750355f
Merge branch 'master' into fix/autosaves
f28f2de
Merge branch 'master' of github.com:WordPress/gutenberg
b4b95e0
Merge branch 'master' of github.com:WordPress/gutenberg
b68c7a5
Merge branch 'master' of github.com:WordPress/gutenberg
159d6e0
Merge branch 'master' into fix/autosaves
9142591
document autosave as a parameter property for options
6e7c57c
remove redundant check for isEditedPostNew
5ee1cae
rename currentlyAutosaving -> isAutosaving
7247780
move autosave reducer outside editor
193d32e
set the default autosave state to null
35f41ee
remove unneded object check that confused logic
9af3e3f
fix for eslint
e83bdc2
ensure href set before using in gutenberg_add_target_schema_to_links
dfc22ed
Merge branch 'master' of github.com:WordPress/gutenberg
00d586a
Merge branch 'master' into fix/autosaves
07cccd7
include the autosaves controller
dbd3ab6
docblock object -> boolean
4204ad2
document isAutosaving reducer
dfe6bc3
document autosave reducer
6cd8729
skip destructuring post
7e8b6a2
eliminate unneeded conditional
bb26c8c
rename autosavable -> autosaveable (with an e)
a4eab38
Simplify class check
0ca5be0
fixes for phpcs
d253b12
savePost on CMD-S
b06eb18
correctly return autosave from selector
668907b
correct state autosave usage
0d1f9b5
fix docblock
92b8d79
add test: should stop autosave timer when the autosave is up to date
376379d
correct test naming: should stop autosave timer when the autosave is …
74935ff
Add an e2e test for post autosaving
85a67cd
whitespace
c81ab2a
Merge branch 'master' into fix/autosaves
d795e1d
respect AUTOSAVE_INTERVAL for autosave timing
2531102
reset saving state on `RESET_AUTOSAVE`
264965d
add mu plugin to lower the autosave interval for testing
f1df3ff
docs spacing
b7042f7
Add JSDoc for hasAutosave
1fe8e20
eslint: missing trailing comma
c31eb05
Add tests for the hasAutosave selector
f88fe54
remove unused isAutosave in REQUEST_POST_UPDATE_SUCCESS
5b5107b
adjust initial state for autosave test
2012003
only pass autosaveInterval
89131f1
Testing: Trigger programmatic autosave
aduth e2e05e5
Merge branch 'fix/autosaves' of github.com:WordPress/gutenberg into f…
3e5e744
Merge branch 'master' of github.com:WordPress/gutenberg
2042645
Merge branch 'master' into fix/autosaves
bd29ca0
revert 2012003
751a47c
remove unused `className`
7b1945a
use isAutosaving
7fd7c79
Drop autosave interval back to 10 seconds, because 60 is really slow
danielbachhuber 7034cdc
clarify use of isEditedPostSaveable in effects/AUTOSAVE
20f2b43
Merge branch 'fix/autosaves' of github.com:WordPress/gutenberg into f…
f669754
Prevent autosaves if an autosave is in progress.
7b4bb19
Add isEditedPostSaveable logic to isPostAutosaveable
18e1018
autosave monitor tests - use isAutosaveable
1d40167
fix tests for autosave monitor
f8724bd
Autosave: Cancel scheduled autosave when autosaving starts
aduth 7a3e87b
Autosave: Style: Use property shorthand for autosaveInterval assignment
aduth 02f5a15
Revert "revert 2012003"
aduth de5c887
State: Rename `isPostAutosaveable` to `isEditedPostAutosaveable`
aduth 8347b52
State: Implement `isEditedPostAutosaveable` as composing `isAutosavin…
aduth 66505be
State: Implement autosave action as action creator
aduth 77ce650
State: Improve isAutosavingPost selector JSDoc
aduth e0c33c8
State: Revert doAutosave action creator name to autosave
aduth 4e82c42
Testing: Avoid potential race conditions on Cmd+S save fail
aduth 5d25123
State: Prevent save request if post is not saveable
aduth 747f90c
State: Implement autosaving as superset of saving condition
aduth dc2e758
State: Consider save-in-progress as unsaveable
aduth 8d5dcf0
Testing: Evaluate autosave completion by class presence
aduth 83ad219
Keyboard Shortcuts: Disallow non-dirty save requests
aduth 4821f49
State: Track autosave object as subset of received properties
aduth 2dfc666
State: Remove redundant condition from autosaveable
aduth 102b944
State: Simplify isEditedPostAutosaveable as Array#some of fields
aduth 563a294
State: Deprecate getEditedPostExcerpt selector
aduth 0bec4ea
Merge branch 'master' into fix/autosaves
danielbachhuber f3e564a
Remove tests originally removed in bdcbf714345045b5c96ef2d61ee986a1cf…
danielbachhuber 11f9930
Fix linting
danielbachhuber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prevent autosaves if an autosave is in progress.
- Loading branch information
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return
ing here is not preventing, since it's the behavior oftoggleTimer
to either schedule or cancel a scheduled autosave. So if atoggleTimer( true )
had been called previously and on the nextcomponentDidUpdate
isAutosave
istrue
, the scheduled autosave won't be stopped.Should we want this to be considered instead as part of the condition below? i.e.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that would work, although as you point out this only affects the setting of the timer. to truly prevent a duplicate request, we need to check if an autosaving is happening right before we try to initiate a new one.