ML-188: guard PubSub record updates during edit mode

Add live_action guard to handle_info({:update, record}) in both
CollectionLive.Show and WishlistLive.Show. When the user is editing,
background worker updates are skipped and a warning toast is shown
instead of overwriting the socket. Normal show-mode updates and
mismatched-ID no-ops are unchanged.

6 tests added covering all three code paths.
This commit is contained in:
Claudio Ortolina
2026-05-19 11:38:42 +01:00
parent 2fca0bb106
commit e204e555bd
9 changed files with 236 additions and 27 deletions
+6
View File
@@ -2556,3 +2556,9 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "ISO format"
msgstr ""
#: lib/music_library_web/live/collection_live/show.ex
#: lib/music_library_web/live/wishlist_live/show.ex
#, elixir-autogen, elixir-format
msgid "Record was updated in the background. Your edits may be stale — save and re-open to see the latest data."
msgstr ""
+6
View File
@@ -2556,3 +2556,9 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "ISO format"
msgstr ""
#: lib/music_library_web/live/collection_live/show.ex
#: lib/music_library_web/live/wishlist_live/show.ex
#, elixir-autogen, elixir-format
msgid "Record was updated in the background. Your edits may be stale — save and re-open to see the latest data."
msgstr ""