Closed Bug 769171 Opened 12 years ago Closed 8 years ago

swapCache

Categories

(Core :: Networking: Cache, defect)

13 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: chielm, Unassigned)

Details

(Keywords: html5)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5

Steps to reproduce:

I download the new application cache for my web application and when the download is ready I want to swap the cache by using the "applicationCache.swapCache()" function


Actual results:

I get this error: 
"An attempt was made to use an object that is not, or is no longer, usable" code: "11" nsresult: "0x8053000b (InvalidStateError)" location: "<unknown>"


Expected results:

The browser should swap the application cache
Component: Untriaged → Web Apps
Keywords: html5
can u explain this in more details
(In reply to Shalini from comment #1)
> can u explain this in more detail
Component: Web Apps → Networking: Cache
Product: Firefox → Core
QA Contact: untriaged → networking.cache
I can confirm the bug. applicationCache.swapCache() is not working for me too with Firefox 14.0.1.
No problem with 12.x
Test case: http://mozbugs.github.cscott.net/videobug/

We wait until we get the updateready event, verify that the cache status is UPDATEREADY, and then try to call swapCache() and get the InvalidStateError exception.  The AppCache spec (http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html#application-cache-api) specifies that swapCache() should succeed in that situation.
I confirm that as of Firefox/24 calling window.applicationCache.swapCache() inside the onupdateready event causes a DOM Exception to be thrown: An attempt was made to use an object that is not, or is no longer, usable
Seeing the same thing in Firefox 23. Calling window.applicationCache.swapCache() inside onupdateready callback.
how is this bug still listed as UNCONFIRMED ?
I just wonder if this issue affects Firefox OS. Because application cache is of great importance on web apps.
Ditto on bryandonnovan@gmail.com!

What the heck is going on with UNCONFIRMED. I have a screenshot of this issue but I can't post here.

This is Definitely an issue and terrible because it has bitten our team several times in production.

Please, please, please CONFIRM and FIX.
Confirmed in Chrome 30.0.1599.101, and Firefox, any flavor really.
Confirmed in Firefox 25 as well now.
Still a bug.

Since the mozilla team has refused to confirm the bug, investigate, or otherwise fix the bug, we have deleted Firefox from all computers in our organization and now advocate not using Firefox.
Still a bug on FF 37. I can't make the cache work as intented: Swaping the cache when it is ready and reload page.
On Chrome it works perfectly, just dropping the offline mode for FF users.

Even if I swap from within the event listener and reload page, it still use some old cached file this might be another bug...
I had a look at the source code (FF38). there are a few spots that will throw this error but i don't think i understand anything useful. I just attach them here hope someone capable can find out what's the problem.

========================================

  if (!currentAppCache) {
    return NS_ERROR_DOM_INVALID_STATE_ERR;
  }

  // Check the current and potentially newly available cache are not identical.
  if (mAvailableApplicationCache == currentAppCache) {
    return NS_ERROR_DOM_INVALID_STATE_ERR;
  }

  if (mAvailableApplicationCache) {
    nsCString currClientId, availClientId;
    currentAppCache->GetClientID(currClientId);
    mAvailableApplicationCache->GetClientID(availClientId);
    if (availClientId == currClientId)
      return NS_ERROR_DOM_INVALID_STATE_ERR;
  } else if (mStatus != OBSOLETE) {
    return NS_ERROR_DOM_INVALID_STATE_ERR;
  }
Why is this still happening in Firefox 40? This is a critical bug!
We still see this bug in FF ESR (38.6) but not with FF 44. So this might have been fixed between these versions.
wfm based on comment 16.. app cache being removed anyhow
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.