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

Sync scenes: crashes if the getUserData doesn't set a value before the syncEntity is called #1082

Open
leanmendoza opened this issue Feb 27, 2024 · 0 comments
Assignees
Labels
bug Something isn't working new

Comments

@leanmendoza
Copy link

This issue is happening in Godot (not sure in Bevy nor Explorer-Alpha). It works fine in the current reference client because the promise is resolved immediately (by kernel).

This error is logged by the beer-dispenser scene when it's spawned:

Error: Profile not initialized. Called syncEntity inside the main() function.
    at syncEntity2 (file://~scene.js/:14225:13)
    at main (file://~scene.js/:35761:3)
    at Object._INTERNAL_startup_system [as fn] (file://~scene.js/:36162:26)
    at Object.update (file://~scene.js/:12451:26)
    at async Object.onUpdate (file://~scene.js/:36124:3) msg Some("Profile not initialized. Called syncEntity inside the main() function.") @ JsError { name: Some("Error"), message: Some("Profile not initialized. Called syncEntity inside the main() function."), stack: Some("Error: Profile not initialized. Called syncEntity inside the main() function.\n    at syncEntity2 (file://~scene.js/:14225:13)\n    at main (file://~scene.js/:35761:3)\n    at Object._INTERNAL_startup_system [as fn] (file://~scene.js/:36162:26)\n    at Object.update (file://~scene.js/:12451:26)\n    at async Object.onUpdate (file://~scene.js/:36124:3)"), cause: None, exception_message: "Uncaught Error: Profile not initialized. Called syncEntity inside the main() function.", frames: [], source_line: None, source_line_frame_index: None, aggregated: None 

The SDK is trying to get the primary player profile information async, while the main function is called in the first tick, sync after evaluation (https://adr.decentraland.org/adr/ADR-133).

A possible fix would be to use PlayerIdentityData.get(engine.PlayerEntity) to get primary player data.
Other option is to implement retries until the player data is available since the async function can take a bit.

@leanmendoza leanmendoza added bug Something isn't working new labels Feb 27, 2024
@gonpombo8 gonpombo8 self-assigned this Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new
Projects
Status: No status
Development

No branches or pull requests

2 participants