Ticket #2531608 (closed defect)

Reporter


Stephen Murphy
Opened: 12/14/11
Last modified: 05/10/12
Status: closed
Type: defect
Resolution: fixed

Owner


Ryan Grove
Target Release: 3.5.0
Priority: P2 (high)
Summary: Router state not properly restored in Mobile Safari
Description:

Router state is not properly restored on Mobile Safari when visiting an external link and coming back to the page. Desktop Safari behaves correctly. The quick hacky solution is to reload on the
pageshow event.

Type: defect Observed in Version: 3.5.0pr1
Component: None Severity: S2 (high)
Assigned To: Ryan Grove Target Release: 3.5.0
Location: Library Code Priority: P2 (high)
Tags: Relates To:
Browsers: iOS 5
URL: http://produce.yahoo.com/murphys/router.html
Test Information:

Click "External" link
Browser back button
Click "Internal" link
Notice error: "undefined"

Attachments

Attachment #1: router.html (download)

Change History

Ryan Grove

YUI Developer

Posted: 12/14/11
  • component changed from App Framework to Controller
  • location changed to Library Code
  • milestone changed to 3.5.0
  • owner changed from Ryan Grove to Ryan Grove
  • priority changed to P2 (high)
  • severity changed from S1 (critical) to S2 (high)
  • status changed from accepted to assigned
  • summary changed from Router state not properly restored to Router state not properly restored in Mobile Safari

Looks like this nasty Safari bug is rearing its ugly head again: https://bugs.webkit.org/show_bug.cgi?id=34679

Y.HistoryHash contains a workaround for this (it subscribes to the 'unload' event to force Safari not to use the page cache), but iOS 5 continues to use the page cache in spite of the unload event (which is totally not cool).

I'm investigating other workarounds now.

Ryan Grove

YUI Developer

Posted: 12/14/11
  • estimated changed from 0 to 1
  • remaining changed from 0 to 1
  • sprint changed to sprint 2
  • status changed from assigned to accepted

Ryan Grove

YUI Developer

Posted: 12/15/11
  • browser changed from iOS 4,iOS 5,iOS - Next to iOS 5
  • completed changed from 0 to 1
  • remaining changed from 1 to 0
  • status changed from accepted to checkedin

I've implemented a workaround that seems to fix this as far as I can tell. If you could test it in your own code and verify, I'd be much obliged: https://github.com/rgrove/yui3/commit/7dfbbf759aae9856f6ecc64a3f6e886385843627

Stephen Murphy

YUI Contributor

Posted: 12/15/11

That was quick! Thanks, I will try it out.

Eric Ferraiuolo

YUI Developer

Posted: 01/19/12
  • component changed from Controller to None
  • owner changed from Ryan Grove to Thomas S. Sha
  • status changed from checkedin to assigned

The approach to solving this has changed, instead of doing fancy stuff to maintain a reference to the `location` object outside of the scope in which it is used, a new method, `Y.getLocation()` has been added to yui-core. All places in the source which were maintaining these references have been changed to not do so.

Eric Ferraiuolo

YUI Developer

Posted: 01/19/12

Ryan Grove

YUI Developer

Posted: 01/19/12
  • status changed from assigned to checkedin

Jenny Donnelly

YUI Developer

Posted: 05/10/12
  • resolution changed to fixed
  • status changed from checkedin to closed

checkedin -> closed