Skip to content

v0.4.4 — Profile page fix

Choose a tag to compare

@PaulAtkins88 PaulAtkins88 released this 07 Apr 22:37
e9e777c

What's Fixed

Bug: Profile page salary/fixed expenses reverted on every keystroke (#24)

The Profile page useEffect had form (from Mantine useForm()) in its dependency array. Because Mantine creates a new form object reference on every render, every keystroke triggered a new effect run that fetched the server state and overwrote in-progress edits. Fixed by removing form from the dependency array — the fetch only runs once on mount.

Bug: Profile data corruption in multi-user instances

All users had their budget_profiles row keyed on a hardcoded id='profile'. In a multi-user deployment the ON CONFLICT (id) upsert would overwrite the first user's profile with the second user's data. Fixed: user_id is now the primary key; each user has their own isolated profile row.

Migration Notes

Back up your database before upgrading.

Migration 004-budget-profiles-user-id-primary-key.sql runs automatically on backend startup. It:

  1. Deletes any orphaned budget_profiles rows (no matching users record)
  2. Sets user_id NOT NULL
  3. Drops the old id TEXT primary key
  4. Promotes user_id as the new PRIMARY KEY

Existing profile data for authenticated users is preserved as long as the user_id FK reference is intact.

To run manually:

psql "$PG_CONNECTION_STRING" < backend/migrations/004-budget-profiles-user-id-primary-key.sql

Other Changes

  • Removed redundant Zod re-parse in profile controller (middleware already validates)
  • Bumped backend to v1.0.4, frontend to v0.0.4
  • Updated CHANGELOG.md, README.md, backend/README.md (removed stale scaffolding content), frontend/README.md (removed Vite boilerplate)
  • Fixed all remaining PaulAtkins88solid-logic-studios URLs in docs
  • Removed explicit esModuleInterop: false from tsconfig.json to fix TypeScript 6.x CI compatibility (the default for ESM modules is already false)

Full changelog: https://github.com/solid-logic-studios/bucketwise-planner/blob/main/CHANGELOG.md