Skip to content

fix: 7936, make getExplorerInformation return a promise#7958

Open
m3taphysics wants to merge 3 commits intodevfrom
fix/get-explorer-information-7936
Open

fix: 7936, make getExplorerInformation return a promise#7958
m3taphysics wants to merge 3 commits intodevfrom
fix/get-explorer-information-7936

Conversation

@m3taphysics
Copy link
Copy Markdown
Collaborator

@m3taphysics m3taphysics commented Mar 31, 2026

Pull Request Description

fixes #7936

What does this PR change?

Fixes a scene load failure caused by getExplorerInformation returning a plain synchronous object instead of a Promise.

Problem: Scenes calling isMobile() fail to load entirely on v0.136.0-alpha. The SDK's isMobile() internally calls getExplorerInformation({}) and chains .then() on the result, expecting a Promise. However, Runtime.js returns a plain object, causing:

ScriptEngineException: TypeError: (0 , Iz.getExplorerInformation)(...).then is not a function

Fix: Mark getExplorerInformation as async so it implicitly returns a Promise, conforming to the async contract the SDK expects.

Change in Runtime.js (L29):

-module.exports.getExplorerInformation = function (body) {
+module.exports.getExplorerInformation = async function (body) {
     const result = UnityRuntime.GetExplorerInformation()
     return {
         agent: result.agent,
         platform: result.platform,
         configurations: JSON.parse(result.configurationsJson)
     }
 }

References:

  • Affected file: Explorer/Assets/StreamingAssets/Js/Modules/Runtime.js (line 29, commit 63afaba)
  • Build: v0.136.0-alpha (Unity Engine 6000.3.9f1)

Test Instructions

Test Steps

  1. Launch the new Explorer build

  2. Load the following minimal test scene:

    import {} from '@dcl/sdk/math'
    import { getExplorerInformation } from '~system/Runtime'
    
    export function main() {
        getExplorerInformation({}).then(v => {
            console.log("getting information")
            console.log(JSON.stringify(v))
        });
    }
  3. Expected: The scene loads successfully. The console logs "getting information" followed by the JSON payload containing agent, platform, and configurations fields

  4. Expected: The scene loads without throwing TypeError: (...).then is not a function

Quality Checklist

  • Changes have been tested locally
  • Documentation has been updated (if required)
  • Performance impact has been considered — async adds negligible overhead (implicit Promise wrapping via microtask queue; no I/O)
  • For SDK features: Test scene is included

Code Review Reference

Please review our [Code Review Standards](https://github.com/decentraland/unity-renderer/blob/master/docs/code-review-standards.md) before submitting.

@m3taphysics m3taphysics requested review from a team as code owners March 31, 2026 09:44
@github-actions github-actions bot requested a review from anicalbano March 31, 2026 09:44
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

@m3taphysics
Copy link
Copy Markdown
Collaborator Author

@claude review

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 31, 2026

Claude finished @m3taphysics's task in 36s —— View job


Review Complete

  • Gather context
  • Review diff
  • Post findings

The fix is correct and minimal. Adding async to getExplorerInformation wraps the return value in a Promise, satisfying the SDK's .then() contract.

One observation (not blocking): getSceneInformation on line 16 is also synchronous. If the SDK similarly chains .then() on it, it would fail with the same error. Worth verifying whether it needs the same treatment — but out of scope for this PR.

No blocking issues found.


REVIEW_RESULT: PASS ✅
COMPLEXITY: SIMPLE
QA_REQUIRED: YES

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 31, 2026

Claude finished @m3taphysics's task in 36s —— View job


PR Review

  • Read changed file and gather context
  • Analyze the diff and review logic
  • Post review findings

The change is correct and minimal. Adding async to getExplorerInformation makes it return a Promise implicitly, which matches the SDK's expectation of calling .then() on the result.

One observation (not blocking): getSceneInformation (line 16) is also a synchronous function returning a plain object. If the SDK similarly chains .then() on its result, it would have the same issue. Worth checking for consistency — but that's outside the scope of this PR.

No blocking issues found.

REVIEW_RESULT: PASS ✅

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Claude reviewed this PR and found no blocking issues, but assessed it as complex — human DEV review is still required before merging.

@m3taphysics m3taphysics enabled auto-merge (squash) March 31, 2026 10:43
@AnsisMalins
Copy link
Copy Markdown
Contributor

PR 7958

PR number: 7958
Windows change build
Windows baseline build
macOS change build
macOS baseline build

Intel Core i3

Change samples: 2665
Baseline samples: 2668

Metric Change Baseline Delta Improvement
CPU average 33.7 ms 33.7 ms 0.0 ms -0.1%
CPU 1% worst 58.2 ms 56.8 ms 1.4 ms -2.5%
CPU 0.1% worst 137.0 ms 128.6 ms 8.5 ms -6.6% 🔴
GPU average 15.7 ms 15.4 ms 0.3 ms -2.0%
GPU 1% worst 22.5 ms 22.2 ms 0.3 ms -1.6%
GPU 0.1% worst 25.2 ms 29.9 ms -4.6 ms 15.5% 🟢

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 2, 2026

Claude finished @m3taphysics's task in 23s —— View job


PR Review

  • Gather context
  • Review diff
  • Post findings

The change is correct. Adding async to getExplorerInformation makes it return a Promise, satisfying the SDK's .then() contract.

One observation (not blocking): getSceneInformation (line 16) is still synchronous. If SDK code ever chains .then() on it, it will fail with the same error. Worth verifying — but out of scope for this fix.

No blocking issues found.


REVIEW_RESULT: PASS ✅
COMPLEXITY: SIMPLE
QA_REQUIRED: YES

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved by Claude — simple fix/chore with no blocking issues. QA approval is still required.

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 2, 2026

Claude finished @m3taphysics's task in 20s —— View job


PR Review

  • Gather context
  • Review diff
  • Post findings

The change is correct. Adding async to getExplorerInformation makes it return a Promise, satisfying the SDK's .then() contract.

One observation (not blocking): getSceneInformation (line 16) is still synchronous. If SDK code ever chains .then() on it, it will fail with the same error. Worth verifying for consistency — but out of scope for this fix.

No blocking issues found.


REVIEW_RESULT: PASS ✅
COMPLEXITY: SIMPLE
QA_REQUIRED: YES

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved by Claude — simple fix/chore with no blocking issues. QA approval is still required.

@AnsisMalins
Copy link
Copy Markdown
Contributor

PR #7958, run #23905444463

Builds: Windows change, Windows baseline, macOS change, macOS baseline

Intel Core i3

Metric Change Baseline Delta Improvement
Samples 2669 2665
CPU average 33.7 ms 33.7 ms -0.1 ms 0.2%
CPU 1% worst 54.1 ms 57.9 ms -3.8 ms 6.6% 🟢
CPU 0.1% worst 100.4 ms 130.0 ms -29.6 ms 22.7% 🟢
GPU average 16.3 ms 15.5 ms 0.8 ms -5.3% 🔴
GPU 1% worst 21.8 ms 22.0 ms -0.2 ms 1.1%
GPU 0.1% worst 27.1 ms 25.8 ms 1.3 ms -5.2% 🔴

@balducciv
Copy link
Copy Markdown

balducciv commented Apr 3, 2026

PR reviewed and approved by QA on Windows following the PR test instructions. ✅
Smoke test performed on Windows 11 to verify the normal flow is working as expected. ✅

Build: v0.136.0-alpha (PR #7958)
OS: Windows 11

Test results:

  • Scene loaded successfully — Player.log confirms Loading stage: Completed
  • Console logs "getting information" followed by JSON payload with agent, platform, and configurations fields (step 3)
  • No TypeError: (...).then is not a function in Player.log or console (step 4)

Unrelated errors noted (do not affect verdict):

  • GetAudioClipWebRequest 404 — missing audio asset, unrelated to this fix
  • InvalidKeyException: GPUInstancerPro/Standard — GPU shader key issue, unrelated to this fix

Windows:
03 04 2026_11 51 08_REC - scene console

Mac:

Player.log

Screenshot 2026-04-03 at 12 29 37 PM

@AnsisMalins
Copy link
Copy Markdown
Contributor

PR #7958, run #23908382715

Builds: Windows change, Windows baseline, macOS change, macOS baseline

Intel Core i3

Metric Change Baseline Delta Improvement
Samples 2668 2675
CPU average 33.7 ms 33.6 ms 0.1 ms -0.2%
CPU 1% worst 56.0 ms 54.7 ms 1.3 ms -2.4%
CPU 0.1% worst 113.0 ms 117.6 ms -4.6 ms 3.9% 🟢
GPU average 15.8 ms 15.8 ms -0.0 ms 0.3%
GPU 1% worst 22.3 ms 21.2 ms 1.1 ms -5.3% 🔴
GPU 0.1% worst 28.8 ms 24.4 ms 4.5 ms -18.3% 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getExplorerInformation Not Returning a Promise — Scene Load Failure

4 participants