eternagame / eternagame.org

Website for the Eterna citizen science game
https://eternagame.org
BSD 3-Clause "New" or "Revised" License
19 stars 17 forks source link

Displays user submissions to lab upon login #359

Closed tkaragianes closed 1 year ago

tkaragianes commented 1 year ago

Expected Behavior

When you visit a lab page (https://eternagame.org/labs/11836771) without being logged in, you don't see a user submission dial. (Correct behavior)

If you login on this page, the user submission dial should appear and display the total number of solutions for the logged in user. ``

Current Behavior

Currently, the user submission dial ('My Submissions') will appear after logging in, but it will display the total number of user solutions, rather than this user's submitted solutions.

image

Reproduction Steps

Visit https://eternagame.org/labs/11836771 while logged out, and then login.

Environment

No response

Other information

No response

tkaragianes commented 1 year ago

This is a bug in the project model’s get_project function (and specifically in this line $res['total_submitted_solutions_of_user'] = $this->getTotalSubmittedSolutions($puzzleList, $uid);).

getTotalSubmittedSolutions doesn’t properly handle incognito users. However, the fix here needs to be triggering a project fetch on login