Closed Bug 825618 Opened 11 years ago Closed 8 years ago

applicationCache.status incorrect during update, missing lengthComputable, loaded and total on appcache progress event

Categories

(Core :: DOM: Core & HTML, defect)

17 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: natevw, Assigned: mayhemer)

References

()

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17

Steps to reproduce:

I'm registering all listeners on applicationCache and *additionally* adding periodic polling to manually check applicationCache.status, and still unable to provide any sort of useful feedback to users.

See example code here:
https://github.com/natevw/Metakaolin/blob/a1f14bac5723e3c120213df66accf2c65eca945f/_attachments/index.html#L437


Actual results:

This shows a nice progress/complete/error status in Chrome and Safari. In Firefox however it constantly shows "Not cached" (basically the error message) unless the user happens to leave the app open long enough for a large list of resources to be downloaded. Then *only on refresh* it updates to "Ready" and is fine.


Expected results:

Firefox does not:

- set applicationCache.status properly, except apparently at page load
- provide item count info in its progress events
- really provide reliable cache events at all
Could you attach a minimal testcase to this bug report with STR, please.
Flags: needinfo?(natevw)
The reporter had posted a comment in bug 432055; maybe it is a duplicate or a regression of it.
Component: Untriaged → DOM: Mozilla Extensions
Product: Firefox → Core
(*partial duplicate/regression)
Not at all a testcase, but here's the code I was having trouble with: https://github.com/natevw/Metakaolin/blob/mobile/_attachments/app.js#L91

You can see it in action via https://developer.mozilla.org/en-US/demos/detail/metakaolin

Works fine in Chrome and even Safari, but in Firefox there is neither progress information NOR accurate state information — it almost seemed the applicationCache status is only updated on page load and then never again.
Flags: needinfo?(natevw)
Do you know if it worked in previous versions of Firefox?
Attached patch WIP 1Splinter Review
Confirming.  There are few mistakes in the notification code (fixed by the WIP patch).

We don't expose lengthComputable, loaded and total properties on the event, since we only use a generic DOM event (WIP doesn't include a fix for it).
Assignee: nobody → honzab.moz
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
To make this fully work we also need to review and land bug 730424.
Depends on: 730424
Summary: applicationCache status and eventing ± completely broken → applicationCache.status incorrect during update, missing lengthComputable, loaded and total on appcache progress event
Component: DOM: Mozilla Extensions → DOM
This bug makes App Cache useless for my users who will never know when it's safe to go offline.
CC'ing the patch author to get some news.
Flags: needinfo?(honzab.moz)
Not on my priority list by now.
Flags: needinfo?(honzab.moz)
Is somebody else able to make this fix if mr. Bambas have other priorities please ?
We're using appcache events to make a progressbar for our users but it doesn't work in Firefox because of this bug. We just can't let customers wait for an unknown time on a "loading.gif".
+1.  We're currently having to recommend "against" Firefox and FirefoxOS for our customers wanting to use our offline app due to the "unknown time" issue above.
appcache is dead
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
No it isn't.  It is in live production code with people having to advise their customers not to use Firefox because it's got a very buggy implementation.

What do you expect us to do?  Should we re-write to support service workers?  Not in 2016 we don't with even less support: http://caniuse.com/#search=service%20workers

Or perhaps you're suggesting that if we want offline apps then we should just write a native app for every platform?
(In reply to Neale Upstone from comment #14)
> No it isn't.  It is in live production code with people having to advise
> their customers not to use Firefox because it's got a very buggy
> implementation.
> 
> What do you expect us to do?  Should we re-write to support service workers?
> Not in 2016 we don't with even less support:
> http://caniuse.com/#search=service%20workers
> 
> Or perhaps you're suggesting that if we want offline apps then we should
> just write a native app for every platform?

Please see bug 1237782.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.