cross-posted from: https://lemmy.blahaj.zone/post/46091883

Though nobody expected it in the first place, AI is not perfect and can make mistakes (obviously 🙄) What’s your experience with this? I’d love to hear about it.

    • [object Object]@lemmy.ca
      link
      fedilink
      arrow-up
      8
      ·
      20 hours ago

      This ticket was a small chore rather than critical bug. Just hygiene of keeping ids internal.

      Literally all they needed to do was switch user.id to user.username in the result object.

      The user fields are always in context because they’re stored on the session, and even if they weren’t, there was a fetch on users they could be trivially added to a few lines up in the method. Even a second query in the method wouldn’t be a big deal, as it would add a couple ms at most.

      We get username from another service, so it’s already clean. The AI seems to have not understood this and went insanely defensive.

      Way worse code than the original, though I’m sure it probably passes all the new tests.

      Edit: this is what reading the PR felt like https://www.youtube.com/watch?v=y8OnoxKotPQ