Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Redirection causing infinite digest loop in old android versions #10405

Closed
m3kka opened this issue Dec 10, 2014 · 8 comments
Closed

Redirection causing infinite digest loop in old android versions #10405

m3kka opened this issue Dec 10, 2014 · 8 comments

Comments

@m3kka
Copy link

m3kka commented Dec 10, 2014

Overview of the Issue
Apparently this route configuration

.when('/:test*.html', { redirectTo: function () { return 'test'; }});

is causing infinite digest loop in old android version (versions that require the hashbang mode to be enabled) with new versions of angular (problem appeared since we moved to 1.3.x).

The resulting URL should be
http://myBaseUrl/#/test
but we get something like
http://myBaseUrl/test#/test.html

Angular Version
Tested on 1.3.6

Browsers and Operating System
Every browser that requires hashbang, ie, with an UA similar to:
Mozilla/5.0 (Linux; U; Android 2.1; en-us; GT-I9000 Build/ECLAIR) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2

Reproduce the Error
http://jsbin.com/vifisu/1/edit?html,js,output
(Sorry Plunker is unreachable since this morning)

  1. Open Chrome developer tools
  2. Select old enough phone model (I used Samsung Galaxy S, SII, W)
  3. Reload the page for the UA to be 'applied'
  4. Click on 'Redirect' in the Output window
  5. Check the browser console for the error
@m3kka
Copy link
Author

m3kka commented Dec 12, 2014

Affects all the 1.3.x branch.

1.2.27 does not show this behaviour.

@pkozlowski-opensource
Copy link
Member

@m3kka I'm planning to look into this issue but before I spend more time on this here is one question: what would you expect with this configuration to happen:

angular.module('app', ['ngRoute']).config(function($routeProvider, $locationProvider) {
      $routeProvider.when('/:test*.html', { redirectTo: 'test' });
      $locationProvider.html5Mode(true);
    });

I mean, it tries to redirect to non-existing route, right? What is your real-life use-case?

@m3kka
Copy link
Author

m3kka commented Dec 17, 2014

@pkozlowski-opensource Uhm sorry left some old code from previous test.

http://jsbin.com/boruxuxawo/1/edit?html,js,output

This is stll showing the problem with more straightforward code. Sorry about that.

@btford btford modified the milestones: 1.3.8, 1.3.9 Dec 19, 2014
@julianjelfs
Copy link

Very disappointing that this keeps getting bumped. We are getting a great deal of errors caused by this regression.

@weases
Copy link

weases commented Jan 18, 2015

@julianjelfs yeah, same here

@mgol
Copy link
Member

mgol commented Apr 27, 2015

In which Android versions is this a problem? The original report mentions Android 2.1, I don't think anything below 2.3 is in any way supported.

@julianjelfs
Copy link

I don't think it's actually anything to do do with android. It's any browser that falls back to hash bang routing. Its been broken for so long now that I don't believe anyone has any intention of fixing it.

@petebacondarwin petebacondarwin modified the milestones: 1.4.x - jaracimrman-existence, 1.4.0-rc.2 May 4, 2015
@Narretz Narretz modified the milestones: 1.4.x, 1.5.x May 27, 2016
@Narretz
Copy link
Contributor

Narretz commented Oct 18, 2016

Closing as an old issue. It's likely that this has been fixed in later versions, or can be handled by setting a hashPrefix in the locationProvider. And Android 2.1 is not supported, should it be only a problem on these devices.

@Narretz Narretz closed this as completed Oct 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests