astashov / liftosaur

Weightlifting tracker app for coders
https://www.liftosaur.com
GNU Affero General Public License v3.0
205 stars 28 forks source link

Custom Exercises Broken #107

Closed yashrastogi closed 1 month ago

yashrastogi commented 1 month ago

After recent updates the custom exercises feature has become broken, the custom exercises are present but in program editor it is saying "Error: Unknown exercise (21:0). Add custom exercise"

image

astashov commented 1 month ago

It was frankly broken before, and the fix invalidates some existing exercises. In the program, the exercise name is "Single Leg Calf Press, Leverage Machine", but your custom exercise name is "Single Leg Calf Press".

Curious - if you rename the custom exercise to "Single Leg Calf Press, Leverage Machine" - does it fix the issue?

astashov commented 1 month ago

Also, what's your user id? I can take a look under your account

yashrastogi commented 1 month ago

id: rqulpzcvyw

I thought the equipment is separate from the exercise and doesnt need to be explicitly mentioned during creation of the exercise?

Yes, renaming the custom exercise to "Single Leg Calf Press, Leverage Machine" works.

astashov commented 1 month ago

Yeah, equipment is separate from the exercise, so "Single Leg Calf Press, Leverage Machine" actually being treated as "Single Leg Calf Press" with the equipment "Leverage Machine" was a bug. Custom exercises shouldn't have equipment assumed/associated, and only should have the name. So, "Single Leg Calf Press, Leverage Machine" or "Single Leg Calf Press with leverage machine" or "Single Leg Calf Press" is just a name.

yashrastogi commented 1 month ago

Oh, got it! Thanks.

Great application by the way!

astashov commented 1 month ago

Thanks :)

yashrastogi commented 1 month ago

@astashov the 1rm value for my custom exercises have been reset, for some I remembered the value and set it manually for others is it possible to restore it from history?

astashov commented 1 month ago

@yashrastogi like for all of them? How did it happen? Any specific actions you did? I probably can restore them from a backup, or you can also kinda get them from the estimated 1RM graphs (but it won't be the same...)

yashrastogi commented 1 month ago

For some custom exercises I had just saved the 1rm value and not logged any workouts with it. I guess in the database the 1rm was being stored for the custom exercise + equipment name (how I initially thought it was supposed to be, even for custom ones) so for eg. I wanted the last 1rm value for JM Press custom exercise but I guess it was saved under JM Press, Smith Machine and when you disabled equipment for custom exercises it got reset.