-
Notifications
You must be signed in to change notification settings - Fork 37
feat(game-bridge): enhance error diagnostics and consolidate build output #2785
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
base: main
Are you sure you want to change the base?
Conversation
…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
|
View your CI Pipeline Execution ↗ for commit 7a00284
☁️ Nx Cloud last updated this comment at |
| // 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'; |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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 () => {})'); |
There was a problem hiding this comment.
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.
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
USER_REGISTRATION_ERRORwith:x-amzn-trace-id,x-trace-id)x-amzn-requestid,x-request-id)cf-ray)[GAME-BRIDGE]prefix for easier troubleshooting in CI logsBuild Consolidation
fixUnityBuild.jsscript to consolidate all parcel-generated JavaScript files into a single inlineindex.htmlbuildandbuild:local) to callfixUnityBuild.jsafter parcel build.jsand.mapfiles after consolidation for cleaner Unity integrationOther
pnpm-lock.yamlto resolve conflicts with latest main branchpackages/game-bridge/scripts/**/*.jsto.eslintignoreTesting
Impact