Last Comment Bug 730424 - window.applicationCache.status not getting updated when resources finish loading
: window.applicationCache.status not getting updated when resources finish loading
Status: RESOLVED FIXED
[games:p2]
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: All All
-- normal (vote)
: mozilla23
Assigned To: Honza Bambas (:mayhemer)
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks: gecko-games 825618
  Show dependency treegraph
 
Reported: 2012-02-24 13:24 PST by Luke Wagner [:luke]
Modified: 2013-05-02 08:20 PDT (History)
11 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (4.63 KB, patch)
2012-07-12 15:47 PDT, Honza Bambas (:mayhemer)
michal.novotny: review+
honzab.moz: checkin+
Details | Diff | Splinter Review

Description User image Luke Wagner [:luke] 2012-02-24 13:24:25 PST
These HTML5 games show a common problem in FF (not present in Chrome) where, after the resources are loaded the first time, window.applicationCache.status does not get set to IDLE or UPDATEREADY and hence the game never advances.

 http://gunbros.glu.com
 http://bigtimegangsta.glu.com
 http://bugvillage.glu.com
 http://contractkiller.glu.com

After the resources are fully loaded, if you refresh the page, everything plays fine.  The hang-after-load reproduces if you delete the site's appcache from prefs.

(I don't know anything about the appcache, so maybe this bug is INVALID; I'm just forwarding the bug report.)
Comment 1 User image Boris Zbarsky [:bz] (still a bit busy) 2012-02-24 13:35:57 PST
Honza, can you take a look?
Comment 2 User image Honza Bambas (:mayhemer) 2012-02-27 09:10:53 PST
(In reply to Boris Zbarsky (:bz) from comment #1)
> Honza, can you take a look?

Sure.
Comment 3 User image Honza Bambas (:mayhemer) 2012-03-20 10:34:03 PDT
Luke, just to confirm the STR for this are:
- load one of the URIs
- let the offline cache update finish (the nice progress bar shows that)
- clear offline data using clear recent history dialog
- reload the page, offline cache update runs fully again
=> after the offline cache update is completed the state doesn't change to IDLE

All during a single session of the browser.

Is that so?
Comment 4 User image Luke Wagner [:luke] 2012-03-20 10:50:42 PDT
Nope, simpler than that:
 - clear offline data (if you have visited the URI before)
 - load the URI
=> state doesn't change to IDLE, game stays hung at "100% loaded"

(If you now reload the page, the state is fine, so the game loads fine, so that's the current workaround.)
Comment 5 User image Honza Bambas (:mayhemer) 2012-03-20 10:55:35 PDT
Ok, so I have to close the game page, clear cache, and then have a new tab and go to the game page again.  I don't need to restart Firefox instance.  Is that all so?
Comment 6 User image Luke Wagner [:luke] 2012-03-20 11:16:04 PDT
Should be, yes.
Comment 7 User image Honza Bambas (:mayhemer) 2012-03-20 12:36:27 PDT
So, thanks this report I've found some more bugs around applicationCache.status.  I'll report them separately.

This is definitely a dup of bug 383014.  Thanks the remaining record in moz_cache_groups table the update process believes there was an app cache before and instead of IDLE reports UPDATEREADY.

I'll fix that bug and let you try.

Thanks for quick replies and this whole report, Luke.
Comment 8 User image Honza Bambas (:mayhemer) 2012-03-20 13:50:45 PDT
No, this will be more complicated, my test case had a typo.  I'll report back soon.
Comment 9 User image Honza Bambas (:mayhemer) 2012-03-20 13:56:32 PDT
I think your report is not exactly correct.  I can reproduce the problem (and I know the cause) when I visit the URL for the very first time and have to accept the "allow offline" prompt.  But I don't see it when I later delete the offline cache via the clear history dialog and open the page again in a new tab.  Then the state gets updated for me as expected.
Comment 10 User image Luke Wagner [:luke] 2012-05-24 02:55:52 PDT
Sure.  Any progress on the bug?
Comment 11 User image Honza Bambas (:mayhemer) 2012-05-24 05:48:03 PDT
(In reply to Luke Wagner [:luke] from comment #10)
> Sure.  Any progress on the bug?

So, you agree the description (comment 0) is not fully correct?  Do you agree comment 9 is better description of this bug?

It is on my list of all app cache bugs I want to work on soon.
Comment 12 User image Luke Wagner [:luke] 2012-05-24 09:02:22 PDT
I get a JS error trying to open any of the links in comment 0, so it seems something has changed and I don't know.  I was hoping you were able to see the problem with a simple test-case.
Comment 13 User image Honza Bambas (:mayhemer) 2012-05-24 09:07:54 PDT
(In reply to Luke Wagner [:luke] from comment #12)
> I get a JS error trying to open any of the links in comment 0, so it seems
> something has changed and I don't know.  I was hoping you were able to see
> the problem with a simple test-case.

I found a problem that more or less is what you describe in comment 0.  But not exactly.  Just want to confirm you agree with my findings in comment 9 those IMO better describe this bug.  Note: when I delete the offline cache, I don't delete the offline-app permission (there is no more any prompt on the second visit after delete).
Comment 14 User image Honza Bambas (:mayhemer) 2012-07-12 15:47:38 PDT
Created attachment 641635 [details] [diff] [review]
v1
Comment 15 User image Honza Bambas (:mayhemer) 2012-07-12 16:11:52 PDT
Try: https://tbpl.mozilla.org/?tree=Try&rev=5a536d9749a9
Comment 16 User image Jason Duell [:jduell] (needinfo me) 2013-02-07 22:07:39 PST
Comment on attachment 641635 [details] [diff] [review]
v1

Review of attachment 641635 [details] [diff] [review]:
-----------------------------------------------------------------

Honza has promised me a new unbitrotted version, and I've promised to review it more quickly :)
Comment 17 User image Honza Bambas (:mayhemer) 2013-02-08 11:29:07 PST
Jason, maybe you could at least look at the patches and give comments regardless the patches are outdated..
Comment 18 User image Honza Bambas (:mayhemer) 2013-03-18 11:19:52 PDT
Comment on attachment 641635 [details] [diff] [review]
v1

Michal, can you please take a look?  I believe you are going to be faster then Jason ;)
Comment 20 User image Phil Ringnalda (:philor) 2013-05-01 20:33:39 PDT
https://hg.mozilla.org/mozilla-central/rev/74431003f8cc

Note You need to log in before you can comment on or make changes to this bug.