Skip to content

Preserve cubemap face order during asynchronous URL validation - #5869

Open
Daytonrad wants to merge 1 commit into
aframevr:masterfrom
Daytonrad:fix/cubemap-url-order
Open

Daytonrad wants to merge 1 commit into
aframevr:masterfrom
Daytonrad:fix/cubemap-url-order

Conversation

@Daytonrad

Copy link
Copy Markdown

Description:
Cubemap URLs without recognized image extensions are checked asynchronously with HEAD requests. validateEnvMapSrc appends each validated face as its response arrives, so responses arriving out of order scramble the faces. Mixing extensionless URLs with .png URLs also reorders faces because the latter are validated synchronously.

Changes proposed:

  • Store each validated URL at its original face index and track the number of completed checks separately.
  • Add regression tests for reversed HEAD response order and mixed synchronous/asynchronous validation, including waiting for all six faces and invoking the callback once.

Validation: Both tests fail on the original source with incorrectly ordered face arrays and pass with this change. They were run in installed headless Chrome with Mocha, Chai, Sinon fake XHR and the bundled source module. Both changed files pass the repository ESLint configuration. git diff --check passes. This was a focused browser harness; the complete Karma/WebXR suite and full distribution build were not run.

This branch has not been deployed

No deployments
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.

1 participant