Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webview refreshes every time app is switched to #2719

Open
iloveicedgreentea opened this issue Apr 14, 2024 · 1 comment
Open

Webview refreshes every time app is switched to #2719

iloveicedgreentea opened this issue Apr 14, 2024 · 1 comment

Comments

@iloveicedgreentea
Copy link

iloveicedgreentea commented Apr 14, 2024

iOS device model, version and app version
ios 17
iphone 15 pro
App 2024.624

Home Assistant Core Version
2024.4.3

Describe the bug
I am using OTP auth via cloudflare which emails me a pin. I have to put in my email which brings me to the second part of the screen. When I check my email, and then go back to the HA app, it refreshes the webview which breaks the flow. This is very unusual behavior from a webview.

This actually breaks EVERY kind of two factor flow - tokens, MFA, whatever. I can't even switch to my MFA app.

I suspect the error would be happening somewhere around here

@objc private func loadActiveURLIfNeeded() {

To Reproduce
Open a webview in HA app
Switch to an app
Switch back to the app

I think its specifically when the keyboard goes down though

I noticed the webview will refresh when the keyboard is retracted even when I stay in the same app. Maybe there is some code which checks if the keyboard tray was exited?

For example:
Open a webview
enter in some info to validate it refreshed and have the keyboard open
Get a notification (or even swipe down to the notification tray and long press an existing notification)
Long press it and then exit the notification (remains in the same app)
Keyboard disappears and the webview refreshes

Expected behavior
Webview remains where it was and does not refresh

Screenshots

Additional context

@zacwest
Copy link
Member

zacwest commented Apr 15, 2024

The app is not designed to support a use case where it is being redirected to a non-HA URL. This is likely one of many bugs in that area, see #1719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants