Firefox keeps trying to request /api/v1/activity after HTTP 4xx or 5xx errors
Steps to reproduce
- Open the "My Library", "Albums" page in Firefox
- Cause the session to be expired (I stopped the service overnight)
What happens?
Firefox keeps trying to request activity but is getting an 401 error:
[21/Jun/2020:10:21:42 +0100] "GET /api/v1/activity?token=*.*.* HTTP/1.1" 401 58 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0" 1445 1135
[21/Jun/2020:10:22:42 +0100] "GET /api/v1/activity?token=*.*.* HTTP/1.1" 401 58 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0" 1445 1135
[21/Jun/2020:10:23:44 +0100] "GET /api/v1/activity?token=*.*.* HTTP/1.1" 401 58 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0" 1445 1135
[21/Jun/2020:10:24:44 +0100] "GET /api/v1/activity?token=*.*.* HTTP/1.1" 401 58 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0" 1445 1135
[21/Jun/2020:10:25:46 +0100] "GET /api/v1/activity?token=*.*.* HTTP/1.1" 401 58 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0" 1445 1135
2020-06-21 09:31:52,332 django.request WARNING Unauthorized: /api/v1/activity
2020-06-21 09:32:52,437 django.request WARNING Unauthorized: /api/v1/activity
2020-06-21 09:33:54,374 django.request WARNING Unauthorized: /api/v1/activity
2020-06-21 09:34:54,467 django.request WARNING Unauthorized: /api/v1/activity
2020-06-21 09:35:56,429 django.request WARNING Unauthorized: /api/v1/activity
2020-06-21 09:36:56,490 django.request WARNING Unauthorized: /api/v1/activity
I have an HTTPS to HTTP proxy so it also did this while the service was down and returning HTTP 503 errors.
What is expected?
Firefox should stop attempting this after the first HTTP 4xx or HTTP 5xx error.
Context
Funkwhale version(s) affected: 0.21.1+git.08e94691