[wp-trac] [WordPress Trac] #38728: Prevent previewer becoming frozen when refreshing too fast
WordPress Trac
noreply at wordpress.org
Thu Nov 10 05:21:07 UTC 2016
#38728: Prevent previewer becoming frozen when refreshing too fast
--------------------------+--------------------
Reporter: nikeo | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.7
Component: Customize | Version: trunk
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
--------------------------+--------------------
Changes (by westonruter):
* keywords: has-patch => needs-patch
Comment:
@nikeo thanks for the patch and the detailed writeup. I agree that
`refresh` returning a promise would be a good improvement, but that would
fall in the realm of an enhancement so we'll have to target that for 4.8.
As for the defect itself, I was able to reproduce it as well. I'm testing
this by editing the `blogname` setting in Twenty Sixteen to disable the
`postMessage` transport so that every change to the site title causes a
refresh.
Your idea to wait to do a refresh until the previous request has finished
works but it doesn't take into account a key consideration. Consider
WordPress running on a slow site where a refresh could take 10 seconds.
With your patch, if I make a change, then wait a second, and then make a
second change while the preview is being refreshed, the second change I
made will fail to appear in the preview when it finishes loading. So it is
important that whenever `refresh` is called that it `destroy` any existing
request to load the preview and defer to a new `PreviewFrame`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38728#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list