decentraland / decentraland/builder
Hash mismatch when deploying emotes to catalyst
- Dominant language
- TypeScript
- Stars
- 156
- Forks
- 91
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 31
Description
## 🎉 Description
It has been reported by several curators (and we also encountered the same issue while migrating the legacy emotes) that when approving the emotes, when the files need to be uploaded to the catalyst, they get rejected with a hash mismatch.

The problem seems to be the hash generated on the backend _sometimes_ is generated wrong. I could not reproduce the issue by creating and deploying a new collection with an emote, neither on goerli nor mainnet, but this issue has occured at least with 6 collections so far, and it was fixed every time by generating the hash in the frontend.
So **the short term solution** would be to change the frontend to always compute the hashes, ignoring the hash that comes from the server. In order to do that we just need to [remove this `if`](https://github.com/decentraland/builder/blob/master/src/modules/collection/sagas.ts#L829) (and we can remove [the whole `else` block](https://github.com/decentraland/builder/blob/master/src/modules/collection/sagas.ts#L850-L853) too).
The long term solution would be to debug the generation of the hash in the builder-server and see why it generates it wrong _sometimes_. It could be related to [how we build the metadata on the backend](https://github.com/decentraland/builder-server/blob/d47fa5192013421d4adefbe3052d6f8447b172a4/src/Item/hashes.ts#L72-L88) vs [how we build it on the frontend](https://github.com/decentraland/builder/blob/master/src/modules/item/export.ts#L177-L199).
Contributor guide
Assessment
This issue has not been assessed yet.