WordPress-iOS
WordPress-iOS copied to clipboard
NSInvalidArgumentException: *** -[NSURL initFileURLWithPath:]: nil string parameter
Sentry Issue: WORDPRESS-IOS-46M5
NSInvalidArgumentException: *** -[NSURL initFileURLWithPath:]: nil string parameter
?, in -[RCTVideo playerItemForSource:withCallback:]
?, in __19-[RCTVideo setSrc:]_block_invoke
File "main.swift", line 7, in main
...
(12 additional frame(s) were not displayed)
@twstokes, it seems like a new issue introduced in 23.8.
Thanks @kean.
Sentry issue: JETPACK-IOS-16VJ
Sentry issue: JETPACK-IOS-14QD
Sentry issue: WORDPRESS-IOS-44WZ
@twstokes, it seems like a new issue introduced in 23.8.
I found a very similar crash with its first occurrence in 23.0 (4 months ago). The stack trace is identical, so I presume this is not a new crash in 23.8.
Noting that we attempted to resolve an identical stack trace in https://github.com/wordpress-mobile/gutenberg-mobile/issues/6233. The solution was guarding against invalid media URLs in https://github.com/WordPress/gutenberg/pull/54834.
It could be the solution needs to be applied elsewhere or that the solution was incomplete.
Based on the Sentry events, we still get reports of this crash in version 23.9.1.0.
This is currently crash #4 of the WPiOS' list of crashes affecting its crash-free session rate (see p1716963424975869/1716781896.201749-slack-C012H19SZQ8). It's the top unresolved crash (as the other ones in the top 5 have been resolved, but are not necessarily deployed to most users yet).
From glancing at the error, logs, and aforementioned fix for video/audio inserted from a URL, my thought is that we may need to guard against invalid URLs being passed to react-native-video when video/audio is inserted via upload. It could be that we are receiving an unexpected, invalid URL value from the host app during the upload process (e.g., odd returns from upload successes/failures).
Currently, we guard insert from a URL, but we do not apply the same logic for insert via upload. This applies to both Video and Audio blocks, as react-native-video is also used for Audio blocks on iOS.
👋 Thanks for the bump @guarani and suggestion @dcalhoun! @geriux I wouldn't mind trying to help out with this one. I was thinking of implementing the logic (as David suggests) on the insert via upload side.