[SOLVED] Android 15 partially reloads Vue app on resume

I have a Capacitor Android app using Vue, built with Vite. To test it I use a real Samsung Galaxy Tab S6 light tablet (Android 13), Pixel 3a emulator (Android 14) and a Pixel 8 emulator (Android 15).

The app listens for Android resume event. When the app is paused and then resumed, on Android 15 emulator the following events take place: resume callback is triggered (as expected), but then “app started” event happens, the main js file (main.js) is executed along with created and mounted events in the App.vue. This is quite unexpected as on the other devices only the resume event callback is triggered and none of the other events takes place.

I first thought that maybe the app is killed on pause, but the resume behavior is not consistent with a fresh start experience: I don’t see the splash screen, the last page I was visiting is brought back, onResume is triggered etc. This is causing problems in some plugins, for example authStateChange callback from Firebase Authentication plugin (capawsome) never triggers on Pixel 8, whereas in other 2 platforms it does trigger. In short, the app behaves like a half-way restart on this platform and in a completely inconsistent way compared to the other platforms that I use to test the app.

This difference in behavior makes flow control in the program extremely difficult. I really would appreciate some advice here. Is this the normal behavior on Android 15, or have I misconfigured / overlooked something?

Seems like production builds are not affected by this problem. I think live reload functionality causes the issue as I see some lines regarding Vite client trying to connect in the logs. I can live with that. But why this is not happening on other devices is still a mistery to me.