decentraland / sdk

PM repository for SDK
Apache License 2.0
4 stars 4 forks source link

[BUG] triggerSceneEmote loads emote from content url instead of scene base url #1042

Closed cazala closed 6 months ago

cazala commented 9 months ago

Issue Description:

The triggerSceneEmote function does not work when using a custom baseUrl in the entity's urn.

Here's an example scene: link

In that scene there's a button that when click it triggers a triggerSceneEmote action. You will notice that a request is made when tat happens to:

https://peer-ue-2.decentraland.zone/content/contents/bafybeicvhpyt6fhnrxi3zkmv4rlqynbpxsolmskzhodzcwygpsljep5mlm

And it should be done to:

https://builder-api.decentraland.zone/v1/projects/ee7b5bbe-f9be-4ae6-9b7a-b5fd2b5786c4/contents/bafybeicvhpyt6fhnrxi3zkmv4rlqynbpxsolmskzhodzcwygpsljep5mlm

The hash is correct, but the baseUrl is wrong. The base URL is configured in the /about endpoint of the Builder's custom realm: link

As you can see there, the baseUrl is configured in the scenesUrn array with the following value:

urn:decentraland:entity:bafkreiczoxhrxosdeoi4srth6wegejpwsn34bkult6rb7xp3ehejxt4qsi?=&baseUrl=https://builder-api.decentraland.zone/v1/projects/ee7b5bbe-f9be-4ae6-9b7a-b5fd2b5786c4/contents/

That baseUrl is used correctly to load all the assets in the scene, but it fails to load the custom emote via triggerSceneEmote, so probably the issue is related to that particular function.

SDK:

Steps to reproduce:

  1. Deploy a world that makes use or triggerSceneEmote and test it in runtime.

Expected behaviour:

It should load the custom emote from the baseUrl provided in the scene urn.

Current behaviour:

It tries to load the custom emote from the content url defined in the about, instead of the baseUrl defined in the scene urn.

pravusjif commented 6 months ago

Tackled at https://github.com/decentraland/unity-renderer/pull/6084

pravusjif commented 6 months ago

Fix merged, most likely will reach production with @dcl/sdk@7.4.1