Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebXRManager: Remove input source on XR session end #24269

Merged
merged 1 commit into from
Jun 28, 2022

Conversation

marwie
Copy link
Contributor

@marwie marwie commented Jun 23, 2022

Fixes error being thrown when entering AR for a second time:
Uncaught DOMException: Failed to execute 'getPose' on 'XRFrame': XRSpace and XRFrame sessions do not match.

Description

When exiting XR session on mobile AR the controllerInputSources array still has cached input sources. When entering AR twice it sends the still cached input source to the WebXRController.update function. This PR sets the cached input sources to null in onSessionEnd

Error that is being fixed:
image

STRP:

  1. enter AR on mobile
  2. touch on the screen
  3. exit AR on mobile
  4. enter AR again - screen stays black, error shown above is thrown

Issue was introduced in #23188

This contribution is funded by 🌵 needle

Fixes error on 2nd time entering AR: Uncaught DOMException: Failed to execute 'getPose' on 'XRFrame': XRSpace and XRFrame sessions do not match.
@marwie marwie changed the title Remove input source on XR session end WebXRManager: Remove input source on XR session end Jun 23, 2022
@Mugen87 Mugen87 added this to the r142 milestone Jun 24, 2022
@mrdoob mrdoob merged commit 95172e5 into mrdoob:dev Jun 28, 2022
@mrdoob
Copy link
Owner

mrdoob commented Jun 28, 2022

Thanks!

@hybridherbst hybridherbst deleted the webxrmanager-session-mismatch branch September 7, 2022 00:10
abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
Fixes error on 2nd time entering AR: Uncaught DOMException: Failed to execute 'getPose' on 'XRFrame': XRSpace and XRFrame sessions do not match.
snagy pushed a commit to snagy/three.js-1 that referenced this pull request Sep 21, 2022
Fixes error on 2nd time entering AR: Uncaught DOMException: Failed to execute 'getPose' on 'XRFrame': XRSpace and XRFrame sessions do not match.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants