-
-
Notifications
You must be signed in to change notification settings - Fork 71
Description
Describe the bug
Mentioned in Discord:
There's also another subtle issue there that for logged-out users, that AJAX call will be made every time the method is called, because there are no preferences to cache. Should probably fix that too - it's causing non-trivial request load.
This is referring to the preferences function in qpixel_api.js.
To Reproduce
Not applicable. Open the network section of a developer window and visit one of the Codidact communities in a fresh browser instance with no logged in user and no localStorage (such as private browsing in Firefox or incognito in Chrome). Filter to show only URLs containing "preferences". There should ideally be no requests but there are often hundreds. Numbers for a couple of communities can be found in a comment below
Expected behavior
Preferences should only be requested from the server when there is a logged in user.
Screenshots
Not applicable.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Not operating system related.
Additional context
I have not double checked that this is creating server load. Just raising this based on the Discord comment so it can be looked into. Now confirmed - see To Reproduce above.