Preloaded appcache is not populated correctly

RESOLVED FIXED in Firefox OS v2.0

Status

--
blocker
RESOLVED FIXED
4 years ago
10 months ago

People

(Reporter: yurenju, Assigned: gerard-majax)

Tracking

({regression})

unspecified
2.1 S1 (1aug)
x86_64
Linux
regression
Dependency tree / graph

Firefox Tracking Flags

(blocking-b2g:2.0+, b2g-v1.3 unaffected, b2g-v1.3T unaffected, b2g-v1.4 unaffected, b2g-v2.0 fixed, b2g-v2.1 fixed)

Details

(Whiteboard: [systemsfe])

Attachments

(2 attachments)

+++ This bug was initially created as a clone of Bug #1024980 +++

I tested SUMO and wikipedia app on v1.3 with offline content but it does not work.

STR:
1. Download Wikipedia app from firefoxos-gaia-spain[1] to external-apps/
2. |MOZILLA_OFFICIAL=1 make production|
3. click wikipedia app icon without internet connection

expected: show wikipedia app
actually: got a dialog

please get more information on bug 1024879
QA Contact: jmercado
needinfo? same people on bug 1024890 comment 27, 28, 29
Flags: needinfo?(poirot.alex)
Flags: needinfo?(jduell.mcbugs)
Flags: needinfo?(honzab.moz)
Flags: needinfo?(21)
(Assignee)

Comment 3

4 years ago
(In reply to Yuren [:yurenju] from comment #0)
> +++ This bug was initially created as a clone of Bug #1024980 +++
> 
> I tested SUMO and wikipedia app on v1.3 with offline content but it does not
> work.
> 
> STR:
> 1. Download Wikipedia app from firefoxos-gaia-spain[1] to external-apps/
> 2. |MOZILLA_OFFICIAL=1 make production|
> 3. click wikipedia app icon without internet connection
> 
> expected: show wikipedia app
> actually: got a dialog
> 
> please get more information on bug 1024879

Do you know whether this still happens on 2.0 or on master ?
bug 1024980 is what I want to refer both for comment 0 and comment 1.
I don't know but will verify it later.
[Blocking Requested - why for this release]:

(from :jsmith comment on bug 1024980 comment 26)
> [Blocking Requested - why for this release]:
> 
> I think we made a mistake here punting this bug out of 1.3. Turns out this
> affects multiple preinstalled b2g apps preloading appcache. This was working
> in past releases, so this is a regression.
> 
> We need to get this fixed in the next available release. Otherwise, we will
> risk not allowing partner apps with appcache from having offline access
> until an available network connection is established.
blocking-b2g: --- → 2.0?
QA Whiteboard: [QAnalyst-Triage+][lead-review+]
status-b2g-v1.3: --- → affected
(Assignee)

Comment 7

4 years ago
Okay it's broken even on master.
(Assignee)

Comment 8

4 years ago
STR:
 0. Get preload.py from []
 1. |mkdir -p outoftree_apps && echo "Wikipedia,https://bits.wikimedia.org/WikipediaMobileFirefoxOS/manifest.webapp" >> outoftree_apps/list|
 2. |cd outoftree_apps && python preload.py && cd ..|
 3. |make production|
 4. Disable Wi-Fi and data connection

Expected:
 I can load offline Wikipedia.

Actual:
 I get a message to enable internet connection.
status-b2g-v1.3T: --- → ?
status-b2g-v1.4: --- → ?
status-b2g-v2.0: --- → ?
status-b2g-v2.1: --- → affected
(Assignee)

Comment 9

4 years ago
Fun fact: on first boot, wikipedia does not work offline. But after a second boot, I got an update notification. After downloading it, it does work offline. The app was preloaded a couple of minutes before.
(Assignee)

Comment 10

4 years ago
So /data/local/OfflineCache/ exists, moz_cache_groups is okay but moz_cache table is empty. Comparing the database after applying the update, we have the proper content in the moz_cache table.
(Assignee)

Comment 11

4 years ago
Nice,

> 01-02 04:50:31.219   312   312 E GeckoConsole: [JavaScript Error: "NS_ERROR_NOT_IMPLEMENTED: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsICacheService.createSession]" {file: "resource://gre/modules/OfflineCacheInstaller.jsm" line: 50}]
(Assignee)

Comment 12

4 years ago
This may be broken because of bug 999577, looking at the diff this is the one who added this NS_ERROR_NOT_IMPLEMENTED in CreateSession.
Depends on: 999577
(Assignee)

Comment 13

4 years ago
(In reply to Alexandre LISSY :gerard-majax from comment #12)
> This may be broken because of bug 999577, looking at the diff this is the
> one who added this NS_ERROR_NOT_IMPLEMENTED in CreateSession.

Okay this may be a separate issue :(
(Assignee)

Comment 14

4 years ago
So we are also lacking the root entry point in the cache, i.e., the URL "https://bits.wikimedia.org/WikipediaMobileFirefoxOS/". Hacking this makes the app displays offline.
Flags: needinfo?(21)
(Assignee)

Comment 15

4 years ago
Created attachment 8464704 [details] [diff] [review]
Make OfflineCacheInstaller use AppCacheStorage
(Assignee)

Comment 16

4 years ago
Created attachment 8464708 [details] [diff] [review]
Store launch_path in OfflineCache for AppCache
(Assignee)

Comment 17

4 years ago
Fabrice, hacking an entry matching the launch_path of Wikipedia make it working. But I'm not sure whether adding an entry for launch_path explicitely is the proper way to go to fix this.
Flags: needinfo?(fabrice)
(In reply to Alexandre LISSY :gerard-majax from comment #17)
> Fabrice, hacking an entry matching the launch_path of Wikipedia make it
> working. But I'm not sure whether adding an entry for launch_path
> explicitely is the proper way to go to fix this.

Me neither, especially since your patch stores a url with the path to the index.html. We really need Honza to tell us what has changed here.
Flags: needinfo?(fabrice)
(In reply to Alexandre LISSY :gerard-majax from comment #12)
> This may be broken because of bug 999577, looking at the diff this is the
> one who added this NS_ERROR_NOT_IMPLEMENTED in CreateSession.

Old cache API was disabled, but obviously some code is still trying to use it. See Honza's blog post to see how to use the new API: http://www.janbambas.cz/http-cache-v1-api-disabled/
(Assignee)

Comment 20

4 years ago
(In reply to Michal Novotny (:michal) from comment #19)
> (In reply to Alexandre LISSY :gerard-majax from comment #12)
> > This may be broken because of bug 999577, looking at the diff this is the
> > one who added this NS_ERROR_NOT_IMPLEMENTED in CreateSession.
> 
> Old cache API was disabled, but obviously some code is still trying to use
> it. See Honza's blog post to see how to use the new API:
> http://www.janbambas.cz/http-cache-v1-api-disabled/

This is already fixed by attachment 8464704 [details] [diff] [review]

Honza, adding a fallback entry in the appcache manifest does the trick and thus the only fix needed is to update OfflineCacheInstaller to use the cache v2 API.

I have no idea whether this is what we want. Wikipedia's launch_path is a directory, not a file, since they assume server-side redirection to index.html.
Flags: needinfo?(honzab.moz)
(Assignee)

Comment 21

4 years ago
And bug 999577 is in v2.0, so this should be 2.0+
Assignee: nobody → lissyx+mozillians
status-b2g-v2.0: ? → affected
Whiteboard: [systemsfe]
Target Milestone: --- → 2.1 S1 (1aug)
(Assignee)

Comment 22

4 years ago
Comment on attachment 8464704 [details] [diff] [review]
Make OfflineCacheInstaller use AppCacheStorage

Please find attached a patch that fixes the issue and makes OfflineCacheInstaller properly using the new Cache v2.

Matching try is green at: https://tbpl.mozilla.org/?tree=Try&rev=81c2186f08d9
Attachment #8464704 - Flags: review?(honzab.moz)
(Assignee)

Comment 23

4 years ago
Yuren, using the list of apps from https://github.com/telefonicaid/firefoxos-gaia-spain, I can state the following:
 - without attachment 8464704 [details] [diff] [review]:
  - AccuWeather and Wikipedia do not work
  - no cache is populated at all, and this is expected given that we should be using cache2

 - with attachment 8464704 [details] [diff] [review]:
  - AccuWeather works with the offline notification
  - Wikipedia do not work, because it lacks an entry for its launch_path
  - cache is populated properly besides

I don't think there is more problem. As far as I can tell, launch_path should not point to a directory but rather to a file. So I suspect Wikipedia's manifest is just wrong ?
Flags: needinfo?(yurenju.mozilla)
(Assignee)

Comment 24

4 years ago
In bug 1034730 there is some AppCache testing that has landed, but it seems limited. Maybe we want to improve those tests with this bug :)
Depends on: 1034730
Flags: needinfo?(myk)
Attachment #8464704 - Flags: review?(honzab.moz) → review+
(Assignee)

Updated

4 years ago
Flags: needinfo?(myk)
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
(In reply to Alexandre LISSY :gerard-majax from comment #23)
> Yuren, using the list of apps from
> https://github.com/telefonicaid/firefoxos-gaia-spain, I can state the
> following:
>  - without attachment 8464704 [details] [diff] [review]:
>   - AccuWeather and Wikipedia do not work
>   - no cache is populated at all, and this is expected given that we should
> be using cache2
Blocking given this would be a hard businees requirement for partner apps.
> 
>  - with attachment 8464704 [details] [diff] [review]:
>   - AccuWeather works with the offline notification
>   - Wikipedia do not work, because it lacks an entry for its launch_path
>   - cache is populated properly besides
> 
> I don't think there is more problem. As far as I can tell, launch_path
> should not point to a directory but rather to a file. So I suspect
> Wikipedia's manifest is just wrong ?

NI, Harald to help confirm if we need to reachout to wikipedia for the above?
blocking-b2g: 2.0? → 2.0+
Flags: needinfo?
https://hg.mozilla.org/mozilla-central/rev/feef90e576ae
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
https://hg.mozilla.org/releases/mozilla-b2g32_v2_0/rev/97a32455f28a
status-b2g-v1.3: affected → unaffected
status-b2g-v1.3T: ? → unaffected
status-b2g-v1.4: ? → unaffected
status-b2g-v2.0: affected → fixed
status-b2g-v2.1: affected → fixed
Flags: needinfo?
Flags: needinfo?(jduell.mcbugs)
(Assignee)

Comment 29

4 years ago
Changing launch_path to add index.html at the end fixed Wikipedia, FYI.
Flags: needinfo?(poirot.alex)
seems problem was solved.
Flags: needinfo?(yurenju.mozilla)

Updated

10 months ago
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.