Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions backend/app/database/face_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,13 @@ def db_update_cluster(
)

updated = cursor.rowcount > 0
conn.commit()
if own_connection:
conn.commit()

return updated
finally:
conn.close()
if own_connection:
conn.close()


def db_get_all_clusters_with_face_counts() -> (
Expand Down
9 changes: 9 additions & 0 deletions docs/frontend/state-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,12 @@ const folder = useSelector((state: RootState) =>
```

This Redux-based architecture provides a scalable and maintainable state management solution that grows with our application's complexity.

## React Hooks Guidelines

When working on frontend components, especially in onboarding flows:

- Always include all external variables, props, and functions used inside a `useEffect` hook in its dependency array.
- Avoid using empty dependency arrays (`[]`) when the effect relies on props, Redux dispatch, context values, or functions returned from custom hooks.
- This helps prevent stale closures, unexpected behavior, and navigation issues during multi-step flows.
- Follow the React Rules of Hooks and ensure ESLint hook rules pass before submitting a PR.
Loading