Investigate the SQLAlchemy autoflush warning in household.py #16

Open
opened 2026-11-10 19:47:06 +00:00 by martin · 0 comments
Owner

Summary

The backend periodically logs an SQLAlchemy SAWarning about a ShoppinglistItems object that is not in the session, raised from app/models/household.py:215 during autoflush. It may mean relationship writes are silently skipped.

Context

SAWarning: Object of type <ShoppinglistItems> not in session, add operation along 'Shoppinglist.items' will not proceed
  • Still present in 0.8.1; occurs alongside item add/update activity, a handful of times per week.
  • The warning comes from the automatic flush of a query issued while pending objects exist.

Reproduction steps

Not yet determined. The warning appears during shopping list item updates; no minimal reproduction is known.

Expected behavior

Item updates are persisted without warnings.

Actual behavior

SQLAlchemy drops the pending relationship operation during autoflush and only warns.

Scope

  • Reproduce the scenario and confirm whether any update is actually lost.
  • Report upstream with a minimal reproduction.
  • Patch locally only if the impact is confirmed and upstream is slow to respond.

Acceptance criteria

  • The trigger is identified, or the attempted reproduction is documented as inconclusive.
  • An upstream issue is linked.
  • Impact on stored data is stated explicitly.

Dependencies

  • Upstream: TomBursch/kitchenowl.
## Summary The backend periodically logs an SQLAlchemy `SAWarning` about a `ShoppinglistItems` object that is not in the session, raised from `app/models/household.py:215` during autoflush. It may mean relationship writes are silently skipped. ## Context ```text SAWarning: Object of type <ShoppinglistItems> not in session, add operation along 'Shoppinglist.items' will not proceed ``` - Still present in 0.8.1; occurs alongside item add/update activity, a handful of times per week. - The warning comes from the automatic flush of a query issued while pending objects exist. ## Reproduction steps Not yet determined. The warning appears during shopping list item updates; no minimal reproduction is known. ## Expected behavior Item updates are persisted without warnings. ## Actual behavior SQLAlchemy drops the pending relationship operation during autoflush and only warns. ## Scope - Reproduce the scenario and confirm whether any update is actually lost. - Report upstream with a minimal reproduction. - Patch locally only if the impact is confirmed and upstream is slow to respond. ## Acceptance criteria - [ ] The trigger is identified, or the attempted reproduction is documented as inconclusive. - [ ] An upstream issue is linked. - [ ] Impact on stored data is stated explicitly. ## Dependencies - Upstream: TomBursch/kitchenowl.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Personal/kitchenowl-flake#16
No description provided.