7 ms·
ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages"
- ec109685 6y agoThat pull request needs tests.
- deleted 6y ago[deleted]
- ninkendo 6y agoI love how it just blithely takes on another dependency too. This is all too common in JS dev unfortunately… never implement something yourself if you can take on another useless dependency instead.
- pindab0ter 6y agoConversely, you don’t have to reinvent the wheel of parsing XML and all the nuances that come with that if you use a tried and tested library. I see your point and agree with the general sentiment, but this is no leftpad.
- mdaniel 6y agoStrictly speaking "he@1.2.0" was already present, drug in transitively by something else, that's why the yarn.lock folded the older version into the existing checksum I came very close to commenting on the PR, but since it was pointed out elsewhere that the fix was to the wrong file, I suspected it was going to be closed wontfix anyway
- paulddraper 6y ago> never implement something yourself if you can take on another useless dependency instead. So...your argument is that XML parsing/decoding is useless/too easy and every project should reimplement an XML parser/decoder? If so, I have 0% trust in your judgement.
- ninkendo 6y agoThey're not doing arbitrary parsing, they just need the ability to un-escape XML characters for a particular case. I'd be shocked if (after all the abstraction) the `he` library didn't just have a single function which does that. I'd prefer just seeing how `he` does it and implementing it myself. Moreover, they're already using a `fast-xml-parser` for doing XML parsing. Presumably it doesn't have an unescape function, so they're taking on a dependency on another XML parser (and keeping the old one!) just to get the one function.
- paulddraper 6y agohe is for HTML(/XML) encoding. It's kinda dumb that fast-xml-parser doesn't full parse the XML and leave content+attribute values in raw forms. The docs for fast-xml-parser show how to combine it and he. Had they done that, they wouldn't have this bug that completely breaks the SQS client for me.
- suffer 6y agoT̫̺̳o̬̜ ì̬͎̲̟nv̖̗̻̣̹̕o͖̗̠̜̤k͍͚̹͖̼e̦̗̪͍̪͍ ̬ͅt̕h̠͙̮͕͓e̱̜̗͙̭ ̥͔̫͙̪͍̣͝ḥi̼̦͈̼v҉̩̟͚̞͎e͈̟̻͙̦̤-m̷̘̝̱í͚̞̦̳n̝̲̯̙̮͞d̴̺̦͕̫ ̗̭̘͎͖r̞͎̜̜͖͎̫͢ep͇r̝̯̝͖͉͎̺e̴s̥e̵̖̳͉͍̩̗n̢͓̪͕̜̰̠̦t̺̞̰i͟n҉̮̦̖̟g̮͍̱̻͍̜̳ ̳c̖̮̙̣̰̠̩h̷̗͍̖͙̭͇͈a̧͎̯̹̲̺̫ó̭̞̜̣̯͕s̶̤̮̩̘.̨̻̪̖͔ ̳̭̦̭̭̦̞́I̠͍̮n͇̹̪̬v̴͖̭̗̖o̸k҉̬̤͓͚̠͍i͜n̛̩̹͉̘̹g͙ ̠̥ͅt̰͖͞h̫̼̪e̟̩̝ ̭̠̲̫͔fe̤͇̝̱e͖̮̠̹̭͖͕l͖̲̘͖̠̪i̢̖͎̮̗̯͓̩n̸̰g̙̱̘̗͚̬ͅ ͍o͍͍̩̮͢f̖͓̦̥ ̘͘c̵̫̱̗͚͓̦h͝a̝͍͍̳̣͖͉o͙̟s̤̞.̙̝̭̣̳̼͟ ̢̻͖͓̬̞̰̦W̮̲̝̼̩̝͖i͖͖͡ͅt̘̯͘h̷̬̖̞̙̰̭̳ ̭̪̕o̥̤̺̝̼̰̯͟ṳ̞̭̤t̨͚̥̗ ̟̺̫̩̤̳̩o̟̰̩̖ͅr̞̘̫̩̼d̡͍̬͎̪̺͚͔e͓͖̝̙r̰͖̲̲̻̠.̺̝̺̟͈ ̣̭T̪̩̼h̥̫̪͔̀e̫̯͜ ̨N̟e҉͔̤zp̮̭͈̟é͉͈ṛ̹̜̺̭͕d̺̪̜͇͓i̞á͕̹̣̻n͉͘ ̗͔̭͡h̲͖̣̺̺i͔̣̖̤͎̯v̠̯̘͖̭̱̯e̡̥͕-m͖̭̣̬̦͈i͖n̞̩͕̟̼̺͜d̘͉ ̯o̷͇̹͕̦f̰̱ ̝͓͉̱̪̪c͈̲̜̺h̘͚a̞͔̭̰̯̗̝o̙͍s͍͇̱͓.̵͕̰͙͈ͅ ̯̞͈̞̱̖Z̯̮̺̤̥̪̕a͏̺̗̼̬̗ḻg͢o̥̱̼.̺̜͇͡ͅ ̴͓͖̭̩͎̗ ̧̪͈̱̹̳͖͙H̵̰̤̰͕̖e̛ ͚͉̗̼̞w̶̩̥͉̮h̩̺̪̩͘ͅọ͎͉̟ ̜̩͔̦̘ͅW̪̫̩̣̲͔̳a͏͔̳͖i͖͜t͓̤̠͓͙s̘̰̩̥̙̝ͅ ̲̠̬̥Be̡̙̫̦h̰̩i̛̫͙͔̭̤̗̲n̳͞d̸ ͎̻͘T̛͇̝̲̹̠̗ͅh̫̦̝ͅe̩̫͟ ͓͖̼W͕̳͎͚̙̥ą̙l̘͚̺͔͞ͅl̳͍̙̤̤̮̳.̢
- cldellow 6y agoThe node SDKs for AWS really shock me. The `aws-sdk` v2 API is huge. It and its transitive deps are 64MB. In one TS project that I worked on, adding it added 1.5 seconds of transpilation time. I thought v3 was supposed to be a modular improvement, but even just the `@aws-sdk/client-s3` library is 24MB. Then I see bugs like `v3 has a dependency on react-native` and I really wonder how the process works internally to release these things.
- lvh 6y agoThe Java SDKs are bigger, and what's IMO worse: in Lambda the Python and JavaScript SDKs are automatically installed but the Java SDK is not automagically available on the classpath. Since Lambda is an environment where both artifact size and startup latency matters a lot, this kind of hobbles Java Lambdas. (I work around this mostly by using native-image.)
- uo21tp5hoyg 6y agoThis problem is what lead me to building out my own s3-compatible implementation, sure it doesn't have all the bells and whistles that the official library has but it does what I need and is under 10kb in size.
- paulddraper 6y agoAs I found out in this bug, v3, despite being released last year, is unusable. You can't even stream an object to S3. https://github.com/aws/aws-sdk-js-v3/issues/2348 https://github.com/aws/aws-sdk-js-v3/issues/2348
- renke1 6y agoI was pretty shocked by the bad quality of the Cognito JS library (which is now superseded by the Amplify JS library, afaik). The API design itself was really bad and error handling was based on parsing the textual messages of the HTTP responses (or at least something along those lines). In general I really do like AWS but it made me reluctant to suggest Congito to any of our clients (as opposed to say Firebase Auth which has a nice API and just works).
- 6y ago
- foxbarrington 6y agoFor anyone who doesn't get the reference: https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 https://stackoverflow.com/questions/1732348/regex-match-open...
- TacticalCoder 6y agoOh you beat me to it.
- Rendello 6y ago> regex will consume all living tissue (except for HTML which it cannot, as previously prophesied) This part gets me every time!
- deleted 6y ago[deleted]
- isoprophlex 6y ago> The <center> cannot hold it is too late. Never fails to make me chuckle
- Anthony-G 6y agoNice reference to Yeats’ poem, “The Second Coming”. I guess the infamous Stack Overflow answer is a modern form of poetry.
- jonathanoliver 6y agoWhere I work, we have this post as part of our software developer on-boarding experience. It's required reading.
- goto11 6y agoHave any of the developers noticed the fundamental fallacy in the answer? The question is not about parsing, it is about recognizing a token in a string, which is exactly what regular expressions are designed for.
- TacticalCoder 6y agoFor those unaware of that folklore, the github link contains reference to one of the most famous StackOverflow answer of all times: https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags https://stackoverflow.com/questions/1732348/regex-match-open...
- pcthrowaway 6y agoThanks for sharing, I hadn't seen that. Sadly, I feel like it would get removed as an answer or edited to the SO standards if that was posted as an answer today.
- paulddraper 6y agoUnquestionably. SO's sense of humor died around 2014.
- mattmanser 6y agoThe offending code for those interested: const decodeEscapedXML = (str: string) => str .replace(/&/g, "&") .replace(/'/g, "'") .replace(/"/g, '"') .replace(/>/g, ">") .replace(/</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+decodeEscapedXML&type=Code 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
- formerly_proven 6y agoThat's dreadful code.
- bartwe 6y agoYeah and unpacking & first is asking for trouble with say "&amp;lt;" in your input
- 0x000000E2 6y agoMy 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
- chrisandchris 6y agoCan‘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 ;)
- mdaniel 6y agoYou 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 https://github.com/returntocorp/semgrep
- nathias 6y agoh̴̤̺̞̘͚̮̩̳̫̦͇͖̙͖̼̍͐̿̾̓̂ͣͪ̈́͆ͥ͂ͧ̈́̑͛̉́̚͟͞͡ͅe͑̃ͩ̈́̂̈̈̏̀́̒̍́̾̓҉̵̸̴̛͚͚̼͓͍͙̝̘̠̩̞̦̤̜̠͎̘ ̸̵̨̳̪̯̝̈́̆̎͒ͥ̈͋ͫ̎̈́͆̚̕çͬ͛ͧ̈́͝҉̧̼͔̥̝̘̟̬̰̠̞̝̖̳̮ō̵̡̪̺̮̗̭̳̫͔̮̙͓̼̬͓̦̙̰̠̾̔̀̀͠m̧̛͖͕͉̥̯͇͌͐ͧͭ̓ḙ̢̡̘̖̠̅̈́̀͒̉ͬͮͩ̄̓͋ͫ͜͟͝s͉̪̰͉͎̥̭̹̙̗̖̦̤̮̮̲͕̍͑ͩͯ͆̑ͪ̊̽͐͊͋ͦ̉ͧ̀͘͠͞͠
- raesene9 6y ago(possibly) interestingly, I pased the link to this issue into a slack, which very helpfullly got one of Github's new preview links. The image it produces can't render Zalgo either https://imgur.com/a/pOUu7m1 https://imgur.com/a/pOUu7m1
- wereHamster 6y agolol no even a single test in the PR which supposedly fixes this.
- 0xbadcafebee 6y agoOh hey, another person making a pipeline for EHR records. I wonder how many of these have been remade by now.
- tyingq 6y ago"Thanks to (1), all my HL7 messages in my SQS FIFO queue won't process because carriage returns broke the client." Did my time with HL7. One of those cases where a standard didn't serve any real purpose. It gave the appearance that it might work, but then bred a whole industry of HL7 <-> HL7 translators because nobody's HL7 is the same. If you need a translator/hub, everyone might as well have their own protocol.
- paulddraper 6y agoYeah. I also work with X12 which is far more consistent (because if it isn't, you don't get paid). But the format itself is -- believe it or not -- even worse.