Bug Fix #52

Merged
Lars merged 6 commits from develop into main 2026-03-27 22:16:19 +01:00

6 Commits

Author SHA1 Message Date
448f6ad4f4 fix: use psycopg2 placeholders (%s) not PostgreSQL ($N)
All checks were successful
Deploy Development / deploy (push) Successful in 51s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Bug 1 Final Fix:
- Changed all placeholders from $1, $2, $3 to %s
- psycopg2 expects Python-style %s, converts to $N internally
- Using $N directly causes 'there is no parameter $1' error
- Removed param_idx counter (not needed with %s)

Root cause: Mixing PostgreSQL native syntax with psycopg2 driver
This is THE fix that will finally work!
2026-03-27 22:14:28 +01:00
e4a2b63a48 fix: vitals baseline parameter sync + goal utils transaction rollback
All checks were successful
Deploy Development / deploy (push) Successful in 49s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
Bug 1 Fix (Ruhepuls):
- Completely rewrote vitals_baseline POST endpoint
- Clear separation: param_values array contains ALL values (pid, date, ...)
- Synchronized insert_cols, insert_placeholders, and param_values
- Added debug logging
- Simplified UPDATE logic (EXCLUDED.col instead of COALESCE)

Bug 2 Fix (Custom Goal Type Transaction Error):
- Added transaction rollback in goal_utils._fetch_by_aggregation_method()
- When SQL query fails (e.g., invalid column name), rollback transaction
- Prevents 'InFailedSqlTransaction' errors on subsequent queries
- Enhanced error logging (shows filter conditions, SQL, params)
- Returns None gracefully so goal creation can continue

User Action Required for Bug 2:
- Edit goal type 'Trainingshäufigkeit Krafttraining'
- Change filter from {"training_type": "strength"}
  to {"training_category": "strength"}
- activity_log has training_category, NOT training_type column
2026-03-27 22:09:52 +01:00
ce4cd7daf1 fix: include filter_conditions in goal type list query
All checks were successful
Deploy Development / deploy (push) Successful in 49s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Bug 3 Fix: filter_conditions was missing from SELECT statement in
list_goal_type_definitions(), preventing edit form from loading
existing filter JSON.

- Added filter_conditions to line 1087
- Now edit form correctly populates filter textarea
2026-03-27 21:57:25 +01:00
9ab36145e5 docs: documentation completion summary
All checks were successful
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
Final documentation summary for v0.9h pre-release state.

**Includes:**
- Complete documentation checklist
- Gitea manual actions required
- Resumption guide for future sessions
- Reading order for all documents
- Context prompt for Claude Code

**Status:** All documentation up to date, ready to pause/resume safely.
2026-03-27 21:36:23 +01:00
eb5c099eca docs: comprehensive status update v0.9h pre-release
All checks were successful
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
**STATUS_2026-03-27.md (NEW):**
- Complete current state documentation
- Testing checklist for v0.9h
- Code splitting plan
- Phase 0b roadmap (120+ placeholders)
- Resumption guide for future sessions

**Issue #52 (NEW):**
- Blood pressure goals need dual targets (systolic/diastolic)
- Migration 033 planned
- 2-3h estimated effort

**CLAUDE.md Updated:**
- Version: v0.9g+ → v0.9h
- Dynamic Focus Areas v2.0 section added
- Bug fixes documented
- Current status: READY FOR RELEASE

**Updates:**
- Phase 0a: COMPLETE 
- Phase 0b: NEXT (after code splitting)
- All Gitea issues reviewed
- Comprehensive resumption documentation

**Action Items for User:**
- [ ] Manually close Gitea Issue #25 (Goals System - complete)
- [ ] Create Gitea Issue #52 from docs/issues/issue-52-*.md
- [ ] Review STATUS document before next session
2026-03-27 21:35:18 +01:00
37ea1f8537 fix: vitals_baseline dynamic query parameter mismatch
All checks were successful
Deploy Development / deploy (push) Successful in 56s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
**Bug:** POST /api/vitals/baseline threw UndefinedParameter
**Cause:** Dynamic SQL generation had desynchronized column names and placeholders
**Fix:** Rewrote to use synchronized insert_cols, insert_placeholders, update_fields arrays

- Track param_idx correctly (start at 3 after pid and date)
- Build INSERT columns and placeholders in parallel
- Cleaner, more maintainable code
- Fixes Ruhepuls entry error
2026-03-27 21:23:56 +01:00