Repository navigation
fix(android): use whichever activity in plugin manager - #15798
Legend-Master merged 3 commits into
Conversation
Package Changes Through 2673ed6There are 14 changes which include tauri with minor, tauri-cli with minor, @tauri-apps/cli with minor, tauri-runtime with minor, tauri-runtime-wry with minor, tauri-utils with minor, tauri-bundler with minor, tauri-build with minor, tauri-macos-sign with minor, tauri-codegen with minor, tauri-macros with minor, tauri-plugin with minor, tauri-driver with minor, @tauri-apps/api with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
d0f44c4 to
14e5189
Compare
| } | ||
|
|
||
| activities.remove(activity) | ||
| val nextActivity = activities.firstOrNull() |
There was a problem hiding this comment.
isn't this potentially the wrong order?
like if i go act 1 > 2 > 3, navigate back to 1 this could give me act 1 instead of 2, no?
assuming act 2 is kept alive after going to act 3 which i'm not sure it is
There was a problem hiding this comment.
ah with the onCreate changes this may not matter because the result handler is likely still on act 1 anyway?
There was a problem hiding this comment.
Our entire Android plugin system seems to built on the assumption of a single activity so this is really just a fix for that use case. The multi-activity setup is too broken to fit in that there're really not much can be done here.
Installing an APK over the running app crashed it. Android momentarily
leaves the new activity resumed while the old one is destroyed, and
Tauri's plugin manager answers that by handing its activity result
launchers to the surviving activity — which `registerForActivityResult`
refuses, because it may only be called before its owner reaches STARTED:
IllegalStateException: LifecycleOwner MainActivity is attempting to
register while current state is RESUMED
at app.tauri.plugin.PluginManager.onDestroy
The tunnel survives it — that lives in `:vpn` — but the window dies and
has to be started again, which is a poor way to meet an update.
It is a regression in the `dev` branch we already pin for tao 0.36, from
tauri-apps/tauri#15798, and released 2.11.5 has no such code path. Rather
than pin back past the tao fix the tray needs, the fix is one commit on a
fork: each activity registers its own launchers while it is being created,
the one moment registering is allowed. Reported as tauri-apps/tauri#15948,
submitted as #15949 — when it lands, the patch goes back to upstream.
Verified on a Pixel 8 Pro: six consecutive installs over the running app,
no crash, against a build that crashed on every attempt before.
Fix #15506