fix: delete ash_notifications from pdict after reading

This commit is contained in:
Zach Daniel 2024-08-01 10:42:19 -04:00
parent de7bd3576a
commit f8fc4cd521
2 changed files with 3 additions and 3 deletions

View file

@ -652,8 +652,8 @@ defmodule Ash.Actions.Create.Bulk do
notifications =
if opts[:notify?] do
process_notifications = Process.get(:ash_notifications, [])
bulk_notifications = Process.get({:bulk_create_notifications, ref}) || []
process_notifications = Process.delete(:ash_notifications) || []
bulk_notifications = Process.delete({:bulk_create_notifications, ref}) || []
if opts[:return_notifications?] do
process_notifications ++ bulk_notifications

View file

@ -3225,7 +3225,7 @@ defmodule Ash.Changeset do
notifications =
if instructions[:gather_notifications?] do
Enum.concat(List.wrap(Process.get(:ash_notifications, [])), notifications)
Enum.concat(List.wrap(Process.delete(:ash_notifications) || []), notifications)
else
notifications
end