The Reply to Comments module in HelperX does something that sounds simple: auto-respond to comments on your posts. But "respond to comments" hides a hard sub-problem — how do you know which comments you've already replied to?
Reply to the same comment twice and you look like a broken bot. Skip a comment you haven't answered and you've left a follower hanging. The module has to maintain, for every post, an accurate picture of which comments have been answered and which haven't — and it has to do it without a clean "have I replied?" API flag, because no such flag exists.
This article is about the deduplication system we built. It's a small piece of code with a surprisingly large number of edge cases.
Why this is harder than it looks
The naive mental model: "reply to comments, then mark them as done." That has three problems.






