This is because implementation of terminate callback for ContactImportLive only works if the reason is :normal:
@impl true
def terminate(:normal, socket) do
if socket.assigns.csv_filename do
File.rm(socket.assigns.csv_filename)
end
end
However, here the reason is {:shutdown, :closed}. I'm not sure when (if ever) LiveViews terminate with :normal, but perhaps the implementation of terminate should not check for reason and always try to delete the uploaded file?
Whenever I leave the contact import page, no matter if I performed an import or not, I'm seeing this error in the server log:
This is because implementation of
terminate
callback forContactImportLive
only works if the reason is:normal
:However, here the reason is
{:shutdown, :closed}
. I'm not sure when (if ever) LiveViews terminate with:normal
, but perhaps the implementation ofterminate
should not check for reason and always try to delete the uploaded file?