Skip to content

Mobile Tab switching triggers full page reload and error flash #3896

@sabiwara

Description

@sabiwara

Environment

  • Elixir version (elixir -v): 1.18.4-erlang-27.3.4.1
  • Phoenix version (mix deps): 1.7.21 (also confirmed on 1.8.0-rc.3)
  • Phoenix LiveView version (mix deps): 1.0.7 (also confirmed on 1.0.17)
  • Operating system: debian-bullseye-20250630-slim
  • Browsers you attempted to reproduce this bug on (the more the merrier): Safari on iPhone
  • Does the problem persist after removing "assets/node_modules" and trying again? Yes/no: yes

Actual behavior

On a freshly created liveview app, when reopening a liveview tab on mobile after a while (switching to tabs/apps in btw or locking/unlocking), a full reload is triggered, losing client state and flashing an error message.

Image

I managed to consistently reproduce it on an iPhone with the following steps (unlocking is more predictable than switching tabs):

  • open the tab
  • lock the phone with the side button
  • wait ~10s
  • unlock the phone

This issue is being discussed on https://elixirforum.com/t/mobile-tab-switching-triggers-full-page-reload-in-liveview-is-this-expected-behavior/71188.

As far as I can tell, older versions of liveview (at least livebeats, released a year ago?) don't seem impacted.

Expected behavior

No full-reload, no error message.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions