Skip to content

Conversation

@rodrigo-fournier-immutable
Copy link
Contributor

Summary

This PR enhances error diagnostics in the Game Bridge for Unity and Unreal, and consolidates the parcel build output into a single inline HTML file.

Changes

Error Diagnostics Enhancement

  • Enriched error messages for USER_REGISTRATION_ERROR with:
    • HTTP status code
    • Full URL
    • Trace IDs (x-amzn-trace-id, x-trace-id)
    • Request IDs (x-amzn-requestid, x-request-id)
    • CloudFlare Ray ID (cf-ray)
    • Response body snippet (truncated to 200 chars)
  • Extensive debug logging with [GAME-BRIDGE] prefix for easier troubleshooting in CI logs
  • Browser feature detection logging (BigInt, fetch, ErrorCause, TextEncoder, Promise, AsyncFunction)
  • HTTP error context logging when network failures occur (especially for IMX offchain registration)

Build Consolidation

  • Created fixUnityBuild.js script to consolidate all parcel-generated JavaScript files into a single inline index.html
  • Updated build scripts (build and build:local) to call fixUnityBuild.js after parcel build
  • Removed separate .js and .map files after consolidation for cleaner Unity integration

Other

  • Updated target browser to Chrome 137 for Unity and Unreal builds
  • Updated pnpm-lock.yaml to resolve conflicts with latest main branch
  • Added packages/game-bridge/scripts/**/*.js to .eslintignore

Testing

  • ✅ All ESLint checks pass
  • ✅ Pre-commit hooks pass
  • 🔄 Will trigger automated Game Bridge build that creates PRs in Unity and Unreal SDKs

Impact

  • Unity SDK: Will receive enriched error messages in CI logs, making it easier to debug registration failures
  • Unreal SDK: Same benefits as Unity
  • Developers: Better visibility into HTTP failures during local development

…tput

- Add extensive debug logging with [GAME-BRIDGE] prefix for easier troubleshooting
- Enrich USER_REGISTRATION_ERROR messages with HTTP status, URL, trace IDs, request IDs, cf-ray, and response snippets
- Create fixUnityBuild.js script to consolidate all parcel-generated JS files into a single inline index.html
- Update build scripts to call fixUnityBuild.js after parcel build
- Ensure enriched error messages (with httpStatus/url/trace/reqId/resp) are returned to Unity for CI visibility
- Add browser feature detection logging (BigInt, fetch, ErrorCause, etc.)
- Log detailed HTTP error context when network failures occur (especially for IMX offchain registration)
- Update target browser to Chrome 137 for Unity and Unreal builds
@nx-cloud
Copy link

nx-cloud bot commented Feb 3, 2026

View your CI Pipeline Execution ↗ for commit 7a00284

Command Status Duration Result
nx release publish --tag alpha ✅ Succeeded 47s View ↗
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 2m 18s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-03 05:01:04 UTC

// Backend requires x-sdk-version minor >= 0.42 for /v2/passport/users.
// The default placeholder-based version currently resolves to 0.0.0 in our builds,
// so explicitly set a compatible value via IMXClient overrides.
const imxSdkVersionHeader = '0.42';
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should just set the version to 0.42, the backend may rely on the actual SDK version for other purposes as well.

Can we use the real TS SDK version instead? We have an updateSdkVersion.sh script that updates the SDK version later, can we continue using that?

window.ue.jsconnector.sendtogame(message);
}
} else if (typeof blu_event !== 'undefined') {
console.log('[GAME-BRIDGE] Using blu_event');
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove some of the logging? All of this will be visible to customers if they set the log level to DEBUG. A lot of these logs seem specific to debugging the e2e test failures, and probably aren’t needed all the time.

Also, can we standardise the logging? If we want to add [GAME BRIDGE], please apply it consistently across the existing logs too.

AsyncFunction: (function asyncCheck() {
try {
// eslint-disable-next-line no-eval
eval('(async () => {})');
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider replacing this with a simpler check like
AsyncFunction: (async function() {}).constructor.name === 'AsyncFunction',
This avoids the eslint-disable and security scanner flags.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants