modrinth / code

The Modrinth monorepo containing all code which powers Modrinth!
https://modrinth.com
Other
992 stars 185 forks source link

Some Fields are Placed Randomly in `modrinth.index.json` When Exporting #2510

Open UltimatChamp opened 1 month ago

UltimatChamp commented 1 month ago

Please confirm the following.

What version of the Modrinth App are you using?

0.8.8

Describe the bug

It looks like the sha1 and sha512 fields are placed, randomly, while exporting a modpack. Same is the case for client-server and the minecraft-loader fields. The image shows a diff between two different, simultaneous exports.

Norbiros commented 1 month ago

I don't think this is really an issue. We use hashmaps to store envs/hashes, which means that fields may be unordered when serialized. JSON objects don't require a specific order, and there are probably many other places that also have "random" order

UltimatChamp commented 1 month ago

Yeah, but it's pretty annoying if you upload-n-update files to GitHub. I'm sure that at some point, it did not happen in Modrinth App.

Norbiros commented 1 month ago

We could sort it here or use a btree, but there may be other places with a 'random' order. Have you noticed any others?

UltimatChamp commented 1 month ago

These

It looks like the sha1 and sha512 fields are placed, randomly, while exporting a modpack. Same is the case for client-server and the minecraft-loader fields. The image shows a diff between two different, simultaneous exports.

Oh, yeah! The project files are also randomly placed. So, maybe it's time to fix #1115