-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Fetching template fails on Android 4.0/4.1 when using Appcache manifest. #1356
Comments
No comment on the fix, but I certainly ran into this bug today. If I have my partials appcached, navigate to a page that doesn't use Angular, then hit the back button, the partials do not get loaded. This was on Android 4.1. My solution was to not appcache the partials, which is unfortunate. |
As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months. Please try the newest versions of Angular ( Thanks! |
I ran into this issue with Angular 1.1.5. Also, I looked at the master branch of angular/angular.js, and the code there is:
which is different from 1.1.5 code, but it looks like it still doesn't fix the issue - it should probably be:
in order to address the appcache manifest scenario. (I've confirmed that this latter line fixes the issue, at least on Android 4.3 emulator). So I really think this issue should be reopened. |
Mmm, that change was only made a few weeks ago, and from what I've heard it seems to work --- can you prove that it doesn't? |
When you say "it seems to work", has it specifically been tested with an app manifest on Android?
I am using Angular 1.1.5. I can confirm that if I change the line to the current line in the master branch, "(protocol == 'file' && status === 0)", the bug still occurs, and if I change it to "(protocol == 'file' || status === 0)" the bug disappears. |
I had the same issue like @eugeneos in Angular 1.2.6. Changing from "&&" to "||" helped me. Android stock browser on Android 4.1 sets protocol to "http" and status to "0" |
Android 4.1 stock browser also returns status code 0 when a template is loaded via `http` and the application is cached using appcache. Fixes angular#1356. Closes angular#5547.
Android 4.1 stock browser also returns status code 0 when a template is loaded via `http` and the application is cached using appcache. Fixes angular#1356. Closes angular#5547.
Altering status 0 to 404 (commit 28fc80b) may seem like the right thing to do in some scenarios but it is not a good solution overall as 404 is a HTTP response code and indicates that the server did actually respond. Status 0 should, according to w3.org definition, be considered "some type of network error or fetch termination" (http://www.w3.org/TR/XMLHttpRequest/#the-status-attribute) - i.e server did NOT respond, very different to the meaning of status 404 - "Not found" I discovered this code change after upgrading to latest version of angularjs - my code which handles network/connection problems based on status code 0 stopped working since status 0 is now mapped to 404. |
I encountered an error while developing a mobile web app with AngularJS using an appcache manifest (http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html).
AngularJS can't fetch a template that is cached offline in Android stock browser on Ice Cream Sandwich and Jelly Bean (Gingbread works). The status code returned from XHR is zero comparable to the behaviour of XHR using the file protocol.
The following change works for me and fixes the issue:
joergschiller@63b5e34
What can I provide you to fix this issue?
Greetings
Jörg
The text was updated successfully, but these errors were encountered: