home.social

#whatswrongwiththisjavascriptcode — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #whatswrongwiththisjavascriptcode, aggregated by home.social.

  1. What's wrong with this JavaScript AbortController not aborting?

    What's wrong with this JavaScript AbortController not aborting fetch. The JavaScript code creates AbortController but never calls abort. In JavaScript cleanup never runs and requests pile up.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascriptreli...

    youtube.com/watch?v=Ae80oeaiJ7k

  2. What's wrong with this JavaScript parseInt losing digits?

    What's wrong with this JavaScript parseInt losing digits on user input. The JavaScript code parses a string without radix, so leading zeros trigger octal in older engines. In JavaScript APIs this corrupts IDs.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #ja...

    youtube.com/watch?v=0UH6ovX9Wig

  3. What's wrong with this JavaScript this in callback?

    What's wrong with this JavaScript this in a callback losing context. The JavaScript code passes a method as callback and this becomes undefined. In JavaScript event handlers the method loses its instance.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascriptrel...

    youtube.com/watch?v=qlsIaL1zSSA

  4. What's wrong with this JavaScript async loop?

    What's wrong with this JavaScript async loop in a task runner. The JavaScript code uses forEach with async callbacks, so errors and awaits are ignored. In JavaScript services this drops failures and hides retries.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascript...

    youtube.com/watch?v=6NGGecXhFY4

  5. Why does this JavaScript map drop entries?

    Why does this JavaScript map drop entries in production. The JavaScript code uses JSON stringify as a map key, so object key ordering changes and collisions overwrite data. In JavaScript services this corrupts caches.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascrip...

    youtube.com/watch?v=Ff9tr-MYD5k

  6. What's wrong with this JavaScript temp file?

    What's wrong with this JavaScript temp file creation in a report worker. The JavaScript code writes to a predictable path in /tmp, which can be hijacked with symlinks. In JavaScript servers this can overwrite sensitive files.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance ...

    youtube.com/watch?v=-zgvBu_WXXU

  7. What's wrong with this JavaScript Object.assign overwriting?

    What's wrong with this JavaScript Object.assign overwriting nested objects. The JavaScript code uses Object.assign for config merge. In JavaScript nested objects are copied by reference and get overwritten.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #ja...

    youtube.com/watch?v=WLF_6Q9d75Y

  8. Why does this JavaScript retry charge customers twice?

    Why does this JavaScript retry logic charge customers twice in production. The JavaScript code retries a payment call after a timeout without an idempotency key, so the gateway processes duplicates. In JavaScript billing services this creates double charges and refunds.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascrip...

    youtube.com/watch?v=5T-SagJUr8w

  9. Why does this JavaScript substring vs substr deprecated?

    Why does this JavaScript substring vs substr giving different results. The JavaScript code uses substr which is deprecated and has different semantics. In JavaScript substr start and length vs substring start and end.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperforma...

    youtube.com/watch?v=NuJUpsP2c4E

  10. Why does this JavaScript Array from object returning wrong?

    Why does this JavaScript Array from object returning wrong length. The JavaScript code creates array from array-like using length. In JavaScript a malicious length can allocate huge or wrong size.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascriptrel...

    youtube.com/watch?v=RXjQ1w5hEeg

  11. What's wrong with this JavaScript default parameter evaluation?

    What's wrong with this JavaScript default parameter evaluation timing. The JavaScript code uses an expression as default. In JavaScript defaults are evaluated at call time and can have side effects.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascr...

    youtube.com/watch?v=vegh7-gxWZ4

  12. What's wrong with this JavaScript cache data?

    What's wrong with this JavaScript cache data in a response handler. The JavaScript code caches a mutable array and returns it directly, so callers mutate shared state. In JavaScript services this causes ghost data.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascrip...

    youtube.com/watch?v=kYEdUmbJb2Y

  13. What's wrong with this JavaScript Map for object keys?

    What's wrong with this JavaScript Map for object keys with reference equality. The JavaScript code uses objects as Map keys. In JavaScript key lookup uses reference so same-shaped objects do not match.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascriptrel...

    youtube.com/watch?v=XPMqdgpMOqY

  14. Why does this JavaScript lock file race?

    Why does this JavaScript lock file race under concurrency. The JavaScript code checks for a lock file and then creates it, which is a classic TOCTOU race. In JavaScript workers this lets two processes run the same job.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascript...

    youtube.com/watch?v=VCyRLKmVwAw

  15. Why does this JavaScript lock file race?

    Why does this JavaScript lock file race under concurrency. The JavaScript code checks for a lock file and then creates it, which is a classic TOCTOU race. In JavaScript workers this lets two processes run the same job.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascript...

    youtube.com/watch?v=VCyRLKmVwAw

  16. Why does this JavaScript lock file race?

    Why does this JavaScript lock file race under concurrency. The JavaScript code checks for a lock file and then creates it, which is a classic TOCTOU race. In JavaScript workers this lets two processes run the same job.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascript...

    youtube.com/watch?v=VCyRLKmVwAw

  17. Why does this JavaScript lock file race?

    Why does this JavaScript lock file race under concurrency. The JavaScript code checks for a lock file and then creates it, which is a classic TOCTOU race. In JavaScript workers this lets two processes run the same job.

    #whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascript...

    youtube.com/watch?v=VCyRLKmVwAw