FAQ | This is a LIVE service | Changelog

Skip to content

only try to fetch institutions list and "self" once

Dr Rich Wareham requested to merge github/fork/rjw57/issue-77-fetching-self into master

Testing notes: in order to show the problem this PR addresses, one needs to arrange for the lookupproxy to fail. This can be done by downloading a little test script, corsdevserver.py which can replace the lookupproxy. Run via: docker-compose stop lookupproxy && python2 corsdevserver.py. Without this PR applied, the browser should get stuck in a reload loop for the user's profile.

As noted in #77 (closed), if fetching the user's profile fails, we get stuck in a loop where the browser tries again and again, hammering the browser.

For both the user's profile and the list of instututions, record a "requestedAt" date which records when the last request was in flight. We then only try to load the corresponding resource if:

  1. There is not a resource loaded, and
  2. There is not a request in flight, and
  3. There had not been a request previously.

Number 3 was lacking from our logic before meaning that there was no "memory" of having tried to request the user's profile or list of institutions.

Closes #77 (closed)

Merge request reports

Loading