The moment you open a comment box · slopware 101

slopware 101 · step 32 of 35

The moment you open a comment box

by · 3 min read

A comment box lets your product publish a sentence you did not write, from an address that carries your name. The form may be small; the decisions begin after somebody presses Submit.

What that means legally depends on where you are and what kind of service you run, so find out for your own case. Here we will design the practical life of a comment, from publication to a report and a decision about removal.

Take a small example. You run a blog with comments under each post. Suppose you start with one table, comments, and one action, insert. Then someone posts an advert for a fake pharmacy, and the only tool you have is deleting rows by hand in the database console.

Give the comment a visibility state: published, hidden or removed. Keep reports and appeals as separate records, since a published comment can have several reports and a hidden comment can receive another one. On paper, trace one example: a reader reports a published comment, a moderator hides it while checking, then either restores it or removes it. Which record changes at each step?

You do not need all of these on day one, but you need to know which ones you have. Hidden and removed are different on purpose. Hiding is quick and reversible, the right first move when you are unsure. Removing is a decision, and the author should be able to see that it happened and ask why.

Every move also needs an answer to who may make it. The author can edit and delete their own comment. Any signed-in reader can report, but cannot see who else reported. Only moderators can hide, remove and decide appeals. These checks belong on the server, for the same reason as every other authorization check in this book: a button hidden in the browser is not a permission. Record each change in a second table with who made it, when, and a short reason. When an author appeals, that log is how you answer honestly, and when you get something wrong, it is how you find out.

The report button deserves more respect than it usually gets. It is the channel through which you hear about a problem, and the only one you control. Without it the news still arrives, just later and from someone less patient. Make it easy to find, offer a short list of reasons, and make sure reports reach a person who will read them. Write down who that person is.

Not everything waits for a report. Your form is an API whether you meant it to be or not, so spam arrives at machine speed. A limit on how often one account can post is not about server load. It is about how much one person can put in front of your readers before a human wakes up. Automatic filters can help by ordering the queue, pushing obvious spam down and suspicious posts up, but they are a way of directing human attention, not a way of deciding what is legal.

Then there is what removed actually means. A comment rarely lives in one place. It is a row in the database, but it may also sit in a cached copy of the page, in a search index, in the notification email you sent the post's author, and, if comments can carry images, as a file in your blob storage. List the copies you control and make removal reach them: blank or delete the row, purge the page from the cache, drop it from the search index, delete the file. You cannot recall an email already delivered to someone else. That is a reason to decide how much comment content to put in notifications before sending them.

If your backup scheme retains deleted content until backups expire, document that period and keep the backup copies restricted. A restore also needs to reapply subsequent removals, so a deleted comment does not quietly come back. The retention policy needs to fit the service and its obligations; the live-table delete does not answer that question.

Images raise the stakes. A harmful image is on your storage and served from your domain before anyone has had the chance to report it. If you do not need image uploads yet, do not accept them yet. Hosting comments through a separate service is also a legitimate design. You are choosing where other people's words are kept, and that choice comes before the technical one.

Try the whole path with a harmless test comment: publish it, report it from another test account, decide the report, and verify what its author and an anonymous reader can see. A working Submit button is only the first step of that path.