decentraland / unity-renderer

Unity implementation of Decentraland Client
https://play.decentraland.org
Apache License 2.0
137 stars 93 forks source link

fix: handling of third-party wearable on ExtendedUrnParser class #6201

Closed aleortega closed 4 months ago

aleortega commented 4 months ago

What does this PR change?

This PR addresses how third-party wearables are processed by the ExtendedUrnParser class. This class is responsible for shortening URNs when they are extended (i.e., urn.Split(':').Length > 6). When an extended URN is received, it cuts off the last part and returns the shortened version. This is necessary because the /entities/active endpoint from Catalysts' content servers expects the shortened URN to return the wearable/emote metadata.

The issue was that wearables from third-party providers contain 7 parts, causing the code to mistakenly treat them as extended URNs, which is not the case. Third-party wearables have an additional part but that part do not represent a token id (which is the part that should be removed), so we need to call the Catalysts endpoint using the entire URN received instead of shortening it.

The changes in this PR prevent the removal of the last part of the URN when this method receives a wearable's URN from a third-party provider (i.e., urn.Contains("collections-thirdparty")).

Our Code Review Standards

https://github.com/decentraland/unity-renderer/blob/master/docs/code-review-standards.md

Copilot summary

copilot:summary

github-actions[bot] commented 4 months ago

After the CI passes:

Web

This branch can be previewed at:

Desktop:

If you have the launcher installed (download launcher) you can press open on the following link:

SDK 7

SDK 6

More