[pull] dev from tauri-apps:dev - #420
Merged
Merged
Conversation
* fix(path): return "." from normalize("")
Match Node.js and the existing join("") contract already documented
in the normalize comment.
* test(path): simplify normalize empty-string assertions
---------
Co-authored-by: Xia Chao <236466140+bun-unsafe@users.noreply.github.com>
* fix(windows): use cached focus states for `is_focused` * fmt * Add change file
Destroying an activity while another one was alive crashed the app:
java.lang.RuntimeException: Unable to destroy activity {MainActivity}
Caused by: java.lang.IllegalStateException: LifecycleOwner MainActivity is
attempting to register while current state is RESUMED. LifecycleOwners must
call register before they are STARTED.
at app.tauri.plugin.PluginManager.onDestroy
`onDestroy` handed the manager's launchers to whichever activity was left
by calling `registerResultLaunchers` on it, but that activity was already
running, and `registerForActivityResult` may only be called before its
owner reaches STARTED. There is no moment during another activity's
teardown at which the call is legal.
So the launchers are no longer a property of the manager that migrates.
Each activity registers its own set while it is being created, which is
the one point where registering is allowed, and `onDestroy` only has to
drop the entry and point at whatever remains — which already has
launchers of its own. `LinkedHashMap` rather than a set, so the activity
taken over is the oldest survivor and not an arbitrary one.
Reproduced on Android 15 by reinstalling an APK over the running app,
which momentarily leaves the new activity resumed while the old one is
being destroyed; fixed with this change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )