Bug
In src/features/programs/actions/get-session-by-slug.action.ts, each suggested set's programExerciseId is filled with the session-exercise id instead of a program-exercise reference — a copy/paste that assigns the same value to two fields:
suggestedSets: ex.suggestedSets.map((set) => ({
id: set.id,
programSessionExerciseId: set.programSessionExerciseId,
programExerciseId: set.programSessionExerciseId, // ← same as above
...
set.programSessionExerciseId is the parent ProgramSessionExercise.id (ex.id). The ProgramSuggestedSet model has no programExerciseId column at all, so the field is synthesized — and it's synthesized to the wrong value: it always equals programSessionExerciseId, which already carries the session-exercise id. The real program-exercise identity available in this scope is ex.exerciseId (the underlying Exercise.id).
Impact
Latent: the current ProgramSessionClient doesn't read programExerciseId (it consumes types/valuesInt/valuesSec/units), so today's UI is unaffected. But the SuggestedSet type declares the field and any future consumer / test that relies on it gets a silently wrong value (it can never distinguish the program exercise and will always mirror the session-exercise id).
Fix
Carry the parent's real exercise id into the mapped set:
suggestedSets: ex.suggestedSets.map((set) => ({
id: set.id,
programSessionExerciseId: set.programSessionExerciseId,
programExerciseId: ex.exerciseId,
setIndex: set.setIndex,
...
I have a PR ready.
Bug
In
src/features/programs/actions/get-session-by-slug.action.ts, each suggested set'sprogramExerciseIdis filled with the session-exercise id instead of a program-exercise reference — a copy/paste that assigns the same value to two fields:set.programSessionExerciseIdis the parentProgramSessionExercise.id(ex.id). TheProgramSuggestedSetmodel has noprogramExerciseIdcolumn at all, so the field is synthesized — and it's synthesized to the wrong value: it always equalsprogramSessionExerciseId, which already carries the session-exercise id. The real program-exercise identity available in this scope isex.exerciseId(the underlyingExercise.id).Impact
Latent: the current
ProgramSessionClientdoesn't readprogramExerciseId(it consumestypes/valuesInt/valuesSec/units), so today's UI is unaffected. But theSuggestedSettype declares the field and any future consumer / test that relies on it gets a silently wrong value (it can never distinguish the program exercise and will always mirror the session-exercise id).Fix
Carry the parent's real exercise id into the mapped set:
I have a PR ready.