https://github.com/Magnitus-/gogcli/blob/main/sdk/download-async.go#L26 https://github.com/Magnitus-/gogcli/blob/main/sdk/download-async.go#L29 https://github.com/Magnitus-/gogcli/blob/main/sdk/download.go#L203 https://github.com/Magnitus-/gogcli/blob/main/sdk/download.go#L87 https://github.com/Magnitus-/gogcli/blob/main/sdk/download.go#L322 Code could definitely be cleaned up a little at this point in the sdk (I had to do a lot of unexpected crazy workarounds in this part of the code), but anyways, that's it.
You just compute md5 checksum twice only for the files that have bad metadata (once when you generate the manifest, once when you actually download the file and hopefully check that the downloaded checksum matches what is in the manifest). You detect that the file has bad metadata when it returns a 200 for the metadata request, but the body in the response is messed up.
Simplest solution. All installers are properly downloaded and vetted. Works for all installers no matter the type. No crazy hops across the CDN. It is slower, but as long as only a minority of installers suffer from the problem, you just byte the mostly manageable extra delay.
On an update of ~56 games, I had this much so still a minority of installers:
[sdk] Bad metadata for /downloads/severed_steel/en1installer1: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/sacred_2_gold/en1installer0: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/solasta_crown_of_the_magister/en1installer5: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/phoenix_point_year_one_edition/en1installer0: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/solasta_crown_of_the_magister/en1installer4: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/neon_abyss_alter_ego_pack/en1installer0: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/firewatch/en1installer1: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/dv_rings_of_saturn_anthropogenesis/en1installer0: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/no_mans_sky/en1patch2: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/dead_cells/en1installer0: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/they_always_run/en1patch2: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/hellish_quart/en1installer1: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/sacred_2_gold/fr1installer1: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/firewatch/en1installer0: File metadata was still fetched using much longer workaround method.
[sdk] Bad metadata for /downloads/sacred_2_gold/es1installer1: File metadata was still fetched using much longer workaround method.
If it gets really bad in terms of extra delays, I'd look into other complementary solutions in addition to the above method (CDN hoping in the cloud & possibly innodb verification), but I don't think we're quite there yet (plus those other methods will not work on all installers, so I view them more complementary solutions to speed things up if too many installers need to be downloaded twice as opposed to comprehensive solutions that can stand on their own and work 100% of the time).
In the end, the above method is just that slow, but dependable fallback solution that will always have your back no matter what. So I think regardless of what complementary solutions are implemented to speed things up, the above is pretty much a must if you want to cover all installers dependably.