EvalAI icon indicating copy to clipboard operation
EvalAI copied to clipboard

Fix profile completion percentage fluctuation

Open Armaansaxena opened this issue 3 weeks ago • 0 comments

Description

This PR fixes Issue #3278 where the profile completion percentage would fluctuate (e.g., 40% -> 100% -> 40%) on page refresh.

The Cause: The previous logic iterated over all properties returned by the user API (for var i in result). Since the backend response structure can vary (including/excluding metadata fields or changing order), the total field count count was inconsistent. This caused the percentage calculation (countLeft / count) * 100 to produce random results on refresh.

The Fix: Updated profileCtrl.js to calculate completion based on a predefined list of relevant profile fields (first_name, last_name, affiliation, etc.) instead of iterating over the entire response object. This ensures the denominator is always constant.

Related Issue

Fixes #3278

How Has This Been Tested?

  1. Started the application locally using docker-compose.
  2. Logged in as a superuser.
  3. Navigated to the Profile page.
  4. Refreshed the page 10+ times.
  5. Verified that the "Profile Completed" percentage remains stable and accurate.

Armaansaxena avatar Dec 04 '25 15:12 Armaansaxena