News for hackers. Stuff that matters.
Re:ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages" by mattmanser on Saturday May 08, 2021 @12:43PM (#27088695)
The offending code for those interested:

   const decodeEscapedXML = (str: string) =>
      str
        .replace(/&/g, "&")
        .replace(/'/g, "'")
        .replace(/"/g, '"')
        .replace(/>/g, ">")
        .replace(/&lt;/g, "<");

Seems like it's in multiple places in the code base too, I think all those clients are automatically generated.

https://github.com/aws/aws-sdk-js-v3/search?p=1&q=const+deco...

So that's not even a good fix, think he should have fixed

aws-sdk-js-v3/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/decodeEscapedXML.ts

Re:ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages" by paulddraper on Saturday May 08, 2021 @03:06PM (#27089852)
Very true. AWS doesn't pay me enough to spend time on a comprehensive fix, with tests.

Hopefully they will pay someone to do that.

At least I can read SQS messages now.

Re:ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages" by ufmace on Saturday May 08, 2021 @03:44PM (#27090084)
I've become a lot more sympathetic to this attitude lately.

I kind of enjoy working with Rust, and have written a few minor utilities to interact with AWS in it for work. I found and fixed a few bugs in the library for it, Rusoto. I observed along the way that the project is sorely in need of people to spend time on management and maintenance. I could do that, but...

I can't ignore that AWS makes some absurdly huge amount of money for Amazon. I don't begrudge them that, but I get paid pretty well at my day job already. Why do more of that work for the benefit of AWS for no money? They ought to pay me for it.

Hell, they have more than enough money to hire a team of professional experts in every language under the sun to maintain their AWS libs. Especially considering that the net effect of higher-quality AWS libs in more languages will result in more money being spent on AWS services and more lock-in. There's no excuse for having such terrible code in a mainstream language like Javascript.

Re:ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages" by steveklabnik on Saturday May 08, 2021 @04:04PM (#27090229)
By the way, in case you missed it yesterday: https://news.ycombinator.com/item?id=27080859
Re:ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages" by mattmanser on Saturday May 08, 2021 @04:37PM (#27090459)
Yeah, but you've submitted a PR. It's not a fix, it's broken code. As soon as they run their code generator, it'll disappear.
Re:ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages" by toast0 on Saturday May 08, 2021 @09:02PM (#27092243)
Well it fixed their problem enough, and filing a PR was the level of effort they're willing to put in. It might help someone fix it properly, and it might help someone fix it enough to get moving, so it's potentially good for the origin and good for the users and if not, the origin can close the PR.
Re:ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages" by mattmanser on Monday May 10, 2021 @04:13AM (#27103769)
I'm getting very confused by this attitude.

It's broken code. It's bad code.

Never, ever submit bad code. You're just making even more work for everyone.

Its far worse than doing nothing at all. And if you want to highlight the problem, just raise an issue, point to the problem.

Re:ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages" by formerly_proven on Saturday May 08, 2021 @01:03PM (#27088882)
That's dreadful code.
Re:ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages" by bartwe on Saturday May 08, 2021 @04:24PM (#27090375)
Yeah and unpacking &amp; first is asking for trouble with say "&amp;amp;lt;" in your input
Re:ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages" by 0x000000E2 on Saturday May 08, 2021 @01:34PM (#27089178)
My god. I wish I could find a linter to ban startsWith and regex from my codebases. I swear 99% of their uses are buggy hacky shit
Re:ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages" by mdaniel on Saturday May 08, 2021 @07:00PM (#27091576)
You may find semgrep handy for that, although I don't offhand know how to express "any use of regex" in its language

https://github.com/returntocorp/semgrep

Re:ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages" by chrisandchris on Saturday May 08, 2021 @04:25PM (#27090382)
Can‘t tell you how often I have to use StartsWith/Contains in some interface when connecting to applications together because of the missing ability to extract proper unique/primary keys for objects from any of the systems.

So please don‘t, I need these buggy hacks ;)