Fix spurious Sentry issues for cancelled routes
After the migration to Vue 3 and Vue Router 4, the updated error report for router navigation failures from !1358 (merged) started showing a lot of Cancelled route
errors for navigations that were perfectly normal.
Our cancelled route error handling has a typo in it that spelt cancelled
as canceled
. NavigationFailureType
is an object, so an unknown key returns undefined
. A redirection is considered as a navigation failure with an private error code of 2
; it's a perfectly normal situation and the router is fine with it. Since we call isNavigationFailure(failure, undefined)
, we just check whether the error is a NavigationFailure
and not its type at all, so a normal redirection is reported as a cancelled route.
I noticed that typo because TypeScript embedded in VSCode warned me about it, even though this file has not been entypescriptened yet.