codidact / qpixel

Q&A-based community knowledge-sharing software
https://codidact.com
GNU Affero General Public License v3.0
394 stars 68 forks source link

Default filter user checks (issue #1082) #1120

Closed Oaphi closed 1 year ago

Oaphi commented 1 year ago

This PR addresses issues raised in #1082, in particular — the problem with the client-side JavaScript attempting to fetch default filter for users that are not signed in. CircleCI (rubocop) is expected to fail until #1019 is merged in develop.

Regarding the addition of _pendingUser - it exists to prevent additional calls to /users/me as I noticed there can be up to 5 made because the QPixel#user method doesn't account for other requests in flight. I could use abort signals, but this solution allows us not to send redundant requests in the first place.