mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-08-02 09:45:41 +00:00
fix(deeplink): stop malformed deep links from bricking every launch
Two related defects surfaced from a banner action pezkuwiwallet://.../open/governance:
1. ReferendumDeepLinkHandler.matches() used path.startsWith("/open/gov"), so
"/open/governance" wrongly matched the referendum prefix and then failed with
ReferendumIsNotSpecified (no id). Use an exact path match instead.
2. RootDeepLinkHandler only cleared the persisted pending deep link on success or
HandlerNotFound. A link that matched a handler but failed with a terminal
DeepLinkHandlingException stayed in SharedPreferences and replayed on every
launch ("Referendum not found" on each open). Clear pending on terminal
handling failures in both the fresh-intent and pending-retry paths. This also
auto-recovers already-stuck installs on update.
This commit is contained in:
+3
-1
@@ -31,7 +31,9 @@ class ReferendumDeepLinkHandler(
|
||||
override suspend fun matches(data: Uri): Boolean {
|
||||
val path = data.path ?: return false
|
||||
|
||||
return path.startsWith(ReferendumDetailsDeepLinkConfigurator.PREFIX)
|
||||
// Exact match, not startsWith: otherwise "/open/governance" (and any "/open/gov*") would wrongly
|
||||
// match the referendum prefix "/open/gov" and fail with ReferendumIsNotSpecified.
|
||||
return path == ReferendumDetailsDeepLinkConfigurator.PREFIX
|
||||
}
|
||||
|
||||
override suspend fun handleDeepLink(data: Uri) = runCatching {
|
||||
|
||||
Reference in New Issue
Block a user