VictorAZ12 / web-request-forum

0 stars 0 forks source link

Joined challenges created with incorrect progress. #64

Closed VictorAZ12 closed 5 months ago

VictorAZ12 commented 5 months ago

For each Active challenge a user creates, the progress should always start from 0. However, if a user creates a private habit first, then checks in to make some progress, and deletes that habit, every active challenges joined by this user will start from the progress of the deleted habit. Reproduction:

  1. Create a habit, then checkin image
  2. Delete the habit using the "edit" button
  3. Create a challenge
  4. Join the challenge, the progress doesn't start from 0 image
VictorAZ12 commented 5 months ago

Potential reason: new habits will probably use the id previously occupied by some other deleted habits, which caused incorrect habit progress mapping. Need to clear the progress as well when deleting a habit.