countly-sdk-react-native-bridge icon indicating copy to clipboard operation
countly-sdk-react-native-bridge copied to clipboard

Infinite loop with 301 redirect

Open andreialecu opened this issue 4 years ago • 2 comments

Noticed this while using Flipper while developing.

The countly server url we were using had a redirect. In this case it was a http to https redirection.

image

The sequence above was being logged once every few miliseconds resulting in an infinite loop. This completely kills the app's performance and I suspect results in high battery usage.

We're using 20.4.9. We'll update to the latest version and report if the problem still exists.

andreialecu avatar Apr 07 '21 08:04 andreialecu

The same problem seems to exist on 20.11.5, to some extent. I notice the same messages logged:

[Connection Processor] code:[301], response:[<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
</body>
</html>], request: app_key=...&timestamp=1617785273651&hour=11&dow=3&tz=180&sdk_version=20.11.5&sdk_name=js-rnb-android...
[Connection Processor] Encountered redirect, will retry

However, it seems to no longer loop and do it 50 times per second. It seems to properly wait longer between retries.

Should redirects however be handled more cleanly?

andreialecu avatar Apr 07 '21 08:04 andreialecu

Hello, thank you for reporting this. The high retry rate is a bug the we have observed and we will release a fix of this in the next release.

Currently we don't really handle redirection requests.

ArtursKadikis avatar Apr 09 '21 15:04 ArtursKadikis