Describe the bug
scene_continueUserActivity in src/platform_impl/ios/scene.rs calls .unwrap() on a URL parse result, which will panic and crash the app if a universal link contains a malformed URL:
let url = url.to_string().parse::<url::Url>().unwrap();
The sibling scene_openURLContexts handler in the same file already handles parse failures gracefully using filter_map + log::error!:
url.parse()
.map_err(|e| {
log::error!("failed to parse URL {url} from scene:openURLContexts: {e}");
e
})
.ok()
The two handlers should be consistent — a malformed URL should be logged and skipped, not cause a panic.
Steps To Reproduce
- Create a tao app with multi-scene support enabled (
UIApplicationSupportsMultipleScenes: true in Info.plist)
- Register a universal link domain for the app
- Trigger a
scene:continueUserActivity: callback with a webpageURL containing a malformed URL (e.g. via an NSUserActivity with an invalid URL string)
- The app panics at the
.unwrap() in scene_continueUserActivity
Expected behavior
The malformed URL should be logged as an error and skipped, matching the behavior of scene_openURLContexts.
Screenshots
N/A
Platform and Versions:
- OS: iPadOS 26
- Rustc: 1.87
- tao: 0.35.3
Additional context
The fix is straightforward — replace the .unwrap() with the same filter_map + log::error! pattern used in scene_openURLContexts:
fn scene_continueUserActivity(&self, _scene: &UIScene, user_activity: &NSUserActivity) {
unsafe {
// universal app links
if let Some(url) = user_activity
.webpageURL()
.and_then(|url| url.absoluteString())
{
let url = url.to_string();
match url.parse::<url::Url>() {
Ok(url) => {
app_state::handle_nonuser_event(EventWrapper::StaticEvent(Event::Opened {
urls: vec![url],
}));
}
Err(e) => {
log::error!("failed to parse URL {url} from scene:continueUserActivity: {e}");
}
}
}
}
}
Describe the bug
scene_continueUserActivityinsrc/platform_impl/ios/scene.rscalls.unwrap()on a URL parse result, which will panic and crash the app if a universal link contains a malformed URL:The sibling
scene_openURLContextshandler in the same file already handles parse failures gracefully usingfilter_map+log::error!:The two handlers should be consistent — a malformed URL should be logged and skipped, not cause a panic.
Steps To Reproduce
UIApplicationSupportsMultipleScenes: trueinInfo.plist)scene:continueUserActivity:callback with awebpageURLcontaining a malformed URL (e.g. via an NSUserActivity with an invalid URL string).unwrap()inscene_continueUserActivityExpected behavior
The malformed URL should be logged as an error and skipped, matching the behavior of
scene_openURLContexts.Screenshots
N/A
Platform and Versions:
Additional context
The fix is straightforward — replace the
.unwrap()with the samefilter_map+log::error!pattern used inscene_openURLContexts: