**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
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.
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
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!
Lars
merged commit 979e734bd9 into main2026-03-27 22:16:19 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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