Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop when going back to an unmounted app #96

Closed
CalvinMaighan opened this issue Dec 8, 2020 · 2 comments
Closed

Infinite loop when going back to an unmounted app #96

CalvinMaighan opened this issue Dec 8, 2020 · 2 comments

Comments

@CalvinMaighan
Copy link

CalvinMaighan commented Dec 8, 2020

Hi, this issue seems to be related to this one from angular side:
(single-spa/single-spa-angular#113)

I register both a Public and Private app:

registerApplication({
	name: 'private',
	app: () => import('./private/Private'),
	activeWhen: location => routeMatch(privateRoutes, location.pathname)
});

registerApplication({
	name: 'public',
	app: () => import('./public/Public'),
	activeWhen: location => !routeMatch(privateRoutes, location.pathname)
});

start({
	urlRerouteOnly: true
});

When I switch from the Public one to the Private one, everything works fine. Once I try to go back to Public (ie: Logout) it causes an infinite loop between the /public and /private route. After about 200 times it stops on /public.

The loop mounts Public, then Private fully in between each switch, as API calls that occur on mount also trigger 200 times.

Screen Shot 2020-12-08 at 1 01 57 PM

This is what I see in the console.

Seems like maybe it was fixed on the angular project, maybe its a related issue?

Going to try and re-create it in a separate repo in the coming days

@joeldenning
Copy link
Member

Hi @CalvinMaighan, the first thing I'd check is that you have the latest fixes in single-spa-angular for infinite redirect issues. See single-spa/single-spa-angular#113.

Other than that, this will be hard to diagnose without a demonstration of the issue.

@joeldenning
Copy link
Member

Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants