---
title: "Discussion on \"There Was a Deadlock Hiding in AI-Generated Code — How We Replaced `unreadCount` with `lastReadAt`\" | Hashnode"
description: "Discussion on \"There Was a Deadlock Hiding in AI-Generated Code — How We Replaced `unreadCount` with `lastReadAt`\". 42.8% HTTP error rate, 9 minutes into a load test. The culprit was a single updateMany line carelessly written during AI-assisted coding.\n\n\n1. Discovery — \"Why are we doing 9.5 TPS when the target is"
url: "https://hashnode.com/posts/there-was-a-deadlock-hiding-in-ai-generated-code-how-we-replaced-unreadcount-with-lastreadat/6a01c6abfca21b0d4b1514b2"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [There Was a Deadlock Hiding in AI-Generated Code — How We Replaced \`unreadCount\` with \`lastReadAt\`](https://beckybuilds.hashnode.dev/there-was-a-deadlock-hiding-in-ai-generated-code-how-we-replaced-unreadcount-with-lastreadat?utm_source=hashnode&utm_medium=feed)

42.8% HTTP error rate, 9 minutes into a load test. The culprit was a single updateMany line carelessly written during AI-assisted coding. 1. Discovery — "Why are we doing 9.5 TPS when the target is

May 11 · 8 min read · beckybuilds.hashnode.dev  
Updated Jul 28  
Read the article

-   [#postgresql](https://hashnode.com/tag/postgresql)
-   [#prisma](https://hashnode.com/tag/prisma)
-   [#databases](https://hashnode.com/tag/databases)
-   [#concurrency](https://hashnode.com/tag/concurrency)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#debugging](https://hashnode.com/tag/debugging)

## Written by

[Becky](https://hashnode.com/@becky99)

@becky99 · Seoul

  
[View profile](https://hashnode.com/@becky99)

I build real-time messaging infrastructure that handles 100K concurrent connections — and write about what breaks along the way.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
