Repository navigation
Fix/1877 notification shapes - #2991
Merged
zachdaniel merged 9 commits intoOct 7, 2026
Merged
Conversation
Introduces Ash.Notifier.Notification.input/0 and normalize/1 to accept
either a bare list, a single notification, or %{notifications: [...]}
from before_action/after_action hooks on both Ash.Changeset and
Ash.ActionInput, fixing the inconsistency described in ash-project#1877.
…to fix/1877-notification-shapes
…haelL0827/ash into fix/1877-notification-shapes
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.
Summary
Closes #1877
Normalizes notification values returned from before-action and after-action hooks.
Hooks can now return notifications as:
:notificationskeynilThis behavior is shared across Ash.ActionInput and Ash.Changeset hooks.
Note: the linked issue only mentioned Ash.Changeset, but Ash.ActionInput had the identical inconsistency (same two shapes, same crash pattern), so it's fixed here as well for consistency.
Root Cause
Ash.Notifier.Notification had no shared type or normalization function for its hook-return shapes. As a result, action_input.ex and changeset.ex each accepted a different shape at different call sites: before_action hooks expected %{notifications: [...]}} while after_action hooks expected a bare list. Returning the "wrong" shape for a given hook crashed with a BadMapError or KeyError rather than working consistently.
Changes
Testing
Contributor checklist
Leave anything that you believe does not apply unchecked.