fix: publish all mealplan create, update, and delete events#7015
Open
francisferrell wants to merge 2 commits intomealie-recipes:mealie-nextfrom
Open
fix: publish all mealplan create, update, and delete events#7015francisferrell wants to merge 2 commits intomealie-recipes:mealie-nextfrom
francisferrell wants to merge 2 commits intomealie-recipes:mealie-nextfrom
Conversation
This adds publising of event notifiers for mealplan creation using the /random API endpoint. This also adds new event types for mealplan update and deletion.
This changes EventMealplanCreatedData and the Update and Delete variants from the previous commit to be like other event types with just EventMealplanData and the caller providing the EventOperation.
30035ff to
834ca60
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
The goal of this PR is to have notifier events for all create, update, and delete API endpoints of the mealplan.
POST /api/households/mealplans/randomnow publishes the notifier event for creation of the mealplan same asPOST /api/households/mealplansalready doesPUT /api/households/mealplans/{item_id}now publishes a new notifier event for mealplan updateDELETE /api/households/mealplans/{item_id}now publishes a new notifier event for mealplan updateI'm not sure how to answer "Include anything here that you didn't include in Release Notes above". Also, there isn't a release notes section above. Sorry, at a loss here.
Before

After

Which issue(s) this PR fixes:
Fixes #6914
Special notes for your reviewer:
I'm a first time Mealie contributor. Most of this changeset was achieved by recursive grep for
mealplan\w*createdand then duplicating what I found with -updated and -deleted, without actually understanding the code in question. I have relatively low confidence that I touched every part of the project that this fix actually needs.I have zero experience with alembic. I'm not confident that the change I made is complete from a database perspective.
I don't know if I should manually update
docs/docs/overrides/api.htmlor if it is auto-generated, but it had a hit on my grep and I skipped it because it's like 360k characters on one line.Testing
First I started up a troubleshooting tool...
... and configured a notifier with the apprise address
json://localhost:8080, the http echo container. Then, I recreated the behavior described in #6914.After making the code changes in this PR, I tested different scenarios, again using the http echo container as a notification receiver.
Smooth migration for existing notifiers
Createchecked, so the migration didn't regress itUpdateandDeleteunchecked, so the default of False works as expectedEvents happen as expected when all 3 are checked:
+in the UI still fires an event, as it did before this changeRandom dinnerorRandom sidein the UI fires the same type of event as the+, where it did not beforeEvents happen only for what was checked in the notifier settings:
Create,Update, andDelete, only check oneEvents happen whether the mealplan has a recipe or not