I have set up a new phoenix minimum app that shows the bug , at disposal for who want to run on its own machine
there is a bare live view, phx generated, for “rows” with an onmount callback for index and show
a user has one parameter
the component is called only from the show live view, not the index one
in show.html.heex
<ContactComponent.display row={@row} parameter={@current_user.parameter}/>
defmodule Bg1Web.AssignUser do
alias Bg1.Accounts
import Phoenix.Component
def on_mount(:default, _params, session, socket) do
{
:cont,
socket
|> assign_new(
:current_user,
fn ->
Accounts.get_user_by_session_token_with_parameter(session["user_token"])
end
)
}
end
end
in accounts.ex
def get_user_by_session_token_with_parameter(token) do
get_user_by_session_token(token)|> Repo.preload(:parameter)
end
defmodule Bg1Web.RowLive.Index do
use Bg1Web, :live_view
alias Bg1.Rows
alias Bg1.Rows.Row
on_mount Bg1Web.AssignUser
@impl true
def mount(_params, _session, socket) do
{:ok, assign(socket, :rows, list_rows())}
end
..... rest of mix generated live module
defmodule Bg1Web.RowLive.Show do
use Bg1Web, :live_view
alias Bg1.Rows
alias Bg1Web.ContactComponent
on_mount Bg1Web.AssignUser
@impl true
def mount(_params, _session, socket) do
{:ok, socket}
end
..... rest of mix generated live module
the index page of rows shows that the current_user has its “has one” parameter loaded
if one clicks to the live redirect link, its ok
<%= live_redirect “live redirect Show”, to: Routes.row_show_path(@socket, :show, row) %>
the result is

now if one clicks the full reload link
<a href={"/rows/#{row.id}"}>full reload link</a>
then the bug shows up, so it has to do with assign_new
now from show page, full page reload, call to component commented out
inspect @current_user.parameter shows it’s here
now remove comment for component, full page reload, and same if restart server