You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to replicate this in a failing test in Ash and I can't, which is frustrating. I have it as a failing test in my app though, so I'll try to break that down here.
Describe the bug
When adding cascade_destroy to a resource, and the cascaded records have pubsub notifications configured on destroy, the pubsub notifications are not being generated/sent.
This failure only started occurring after this commit - 23d7479
To Reproduce
Short version - see failing test in Tunez mix test test/tunez/music/album_test.exs:70
test"sends pubsub notifications about the notification deletion"dofollower=insert(:user)album=insert(:album)%{id: notification_id}=insert(:notification,%{album: album,user: follower})TunezWeb.Endpoint.subscribe("notifications:#{follower.id}:destroy")Music.destroy_album!(album,authorize?: false)assert_received%Phoenix.Socket.Broadcast{payload: %{data: %{id: ^notification_id},action: %{name: :destroy}}}endend
1) test destroy sends pubsub notifications about the notification deletion (TunezWeb.Music.AlbumTest)
test/tunez/music/album_test.exs:62
Assertion failed, no matching message after 0ms
The following variables were pinned:
notification_id = "9085a13b-3042-4445-a513-4a8164dcfa65"
The process mailbox is empty.
code: assert_received %Phoenix.Socket.Broadcast{payload: %{data: %{id: ^notification_id}, action: %{name: :destroy}}}
stacktrace:
test/tunez/music/album_test.exs:70: (test)
On an interesting note, if I change the test to use Music.destroy_album!(album, authorize?: false, return_notifications?: true) I do get the notification returned, so its being generated, just not sent? This isn't a bulk action - it's only a single record. I'm not sure what's going on and can't really replicate it anywhere else.
Expected behavior
The test should pass, as it is subscribed to a topic that a pubsub broadcast should be being sent on, when the cascaded record is destroyed.
I've tried to replicate this in a failing test in Ash and I can't, which is frustrating. I have it as a failing test in my app though, so I'll try to break that down here.
Describe the bug
When adding
cascade_destroy
to a resource, and the cascaded records have pubsub notifications configured on destroy, the pubsub notifications are not being generated/sent.This failure only started occurring after this commit - 23d7479
To Reproduce
Short version - see failing test in Tunez
mix test test/tunez/music/album_test.exs:70
Long version:
On an interesting note, if I change the test to use
Music.destroy_album!(album, authorize?: false, return_notifications?: true)
I do get the notification returned, so its being generated, just not sent? This isn't a bulk action - it's only a single record. I'm not sure what's going on and can't really replicate it anywhere else.Expected behavior
The test should pass, as it is subscribed to a topic that a pubsub broadcast should be being sent on, when the cascaded record is destroyed.
Runtime
The text was updated successfully, but these errors were encountered: