[wp-trac] [WordPress Trac] #37032: Guard against infinite reload when setting change causes premature selective refresh

WordPress Trac noreply at wordpress.org
Mon Oct 17 02:12:14 UTC 2016


#37032: Guard against infinite reload when setting change causes premature
selective refresh
--------------------------+--------------------------
 Reporter:  westonruter   |       Owner:  westonruter
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  4.7
Component:  Customize     |     Version:  4.5
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+--------------------------
Changes (by westonruter):

 * keywords:  has-patch needs-testing => needs-patch
 * milestone:  Future Release => 4.7


Comment:

 I think the approach in [attachment:37032.1.diff] is wrong. In addition to
 preventing the triggering of selective refresh we would also need to
 prevent the triggering of JS-based updates. Consider a `blogname`
 sanitizer that enforces title-case: the JS-based update will update the
 site title to be whatever the user entered without that PHP filter. This
 means that if we prevent the selective refresh but still allow
 `postMessage` updates upon refresh, the preview can be invalid. So what we
 need to do is set the values quietly in the preview so as to prevent
 triggering the `change` event _unless_ the setting was modified after the
 last refresh was initiated. So the `sync` message should include a list of
 the newly-changed settings that need to be set with `change` events
 triggered.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37032#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list