Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update Shopping List Timestamp on List Item Update #3453

Open
wants to merge 3 commits into
base: mealie-next
Choose a base branch
from

Conversation

michael-genson
Copy link
Collaborator

What type of PR is this?

(REQUIRED)

  • feature

What this PR does / why we need it:

(REQUIRED)

This PR listens for list item events (create, update, delete) and updates the parent list so the update_at property is changed.

Which issue(s) this PR fixes:

(REQUIRED)

Fixes #3449

Special notes for your reviewer:

The SessionBuffer class is used so the shopping list is only updated once per commit (otherwise a bulk update of 10 items would update the shopping list 10 times). The use of the ContextVar is to prevent race conditions in the FastAPI ASGI context (similar issue to having a global variable shared by multiple threads).

Testing

Pytest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant