-
-
Notifications
You must be signed in to change notification settings - Fork 204
"XRSpace and XRFrame sessions do not match" exception thrown when a session ends and then restarts #473
Open
Description
When an app ends the XR session and then starts it again, the result is a DOMException thrown from createGetXRSpaceMatrix:
space.ts:16 Uncaught DOMException: Failed to execute 'getPose' on 'XRFrame': XRSpace and XRFrame sessions do not match.
at https://localhost:5173/xr/examples/uikit/@fs/C:/Users/gmorgan/github/xr/packages/xr/src/space.ts:11:25
at Object.current (https://localhost:5173/xr/examples/uikit/@fs/C:/Users/gmorgan/github/xr/packages/react/xr/src/space.tsx:229:76)
at update (https://localhost:5173/xr/examples/uikit/node_modules/.vite/deps/chunk-PNRJ6BYA.js?v=bc283d88:13676:22)
at advance (https://localhost:5173/xr/examples/uikit/node_modules/.vite/deps/chunk-PNRJ6BYA.js?v=bc283d88:13729:8)
at handleXRFrame (https://localhost:5173/xr/examples/uikit/node_modules/.vite/deps/chunk-PNRJ6BYA.js?v=bc283d88:13424:11)
at onAnimationFrame (https://localhost:5173/xr/examples/uikit/node_modules/.vite/deps/chunk-PALBDS2N.js?v=bc283d88:29577:37)
at XRSession.onAnimationFrame (https://localhost:5173/xr/examples/uikit/node_modules/.vite/deps/chunk-PALBDS2N.js?v=bc283d88:21747:5)
See the repro case here (I've added a disconnect button to the uikit example that calls session.end()):
https://github.com/griffin2000/xr/blob/gmorgan/bugs/ReproRefSpaceIssue/examples/uikit/app.tsx#L143
Repro steps:
- Checkout main...griffin2000:xr:gmorgan/bugs/ReproRefSpaceIssue
- Build and run examples/uikit
- Connect to https://localhost:5173/xr/examples/uikit/ via Pico Ultra headset browser
- Click "enter VR"
- Click disconnect button to return to non-VR page
- Click "enter VR"
- The page will crash with the DOMException shown above
I can only repro the exception on Pico Ultra (browser 4.0.34), though I believe the error condition exists on all platforms, its just not being caught and thrown by the DOM. I am unable to repro the exception on Quest 3 or Chrome emulator.
Activity
Metadata
Metadata
Assignees
Labels
No labels