← Blog

Programming

The procedure that already existed

In a single day, from scattered emails to a live support system: the rule that holds it all up, the three defects the tests caught before production, and 88 cases fished back out of two years of correspondence. With a quotation that had been waiting years to come true.

25 July 2026  ·  Nanni Ponchietti

The procedure that already existed Full image ↗
The procedure that already existed

Technical emails are a perfect trap: wonderfully easy to write, impossible to find again. For years the MyShop technicians' reports travelled that way — "Hi Nanni, a customer has told us..." — and every case solved ended up buried in a thread with twelve "Re: R: I: Fwd:" that nobody would ever open again. All the work was there. The memory of the work was not.

Yesterday that system was replaced. In a day, from a drawing on paper to a service live in production, with two years of history recovered inside it. It is worth telling how it went, especially the parts where it went wrong.

The rule that holds it all up

The temptation, when you build a ticket system, is to do it properly: rich notifications, the text of the message inside the email, so the technician can read without opening anything. That is exactly how to kill it.

Because if the alert contains the message, the technician replies to the alert. And in three weeks you are back to email, with an empty archive giving you a hard look. So the cardinal rule, decided before a line of code was written: the email is demoted to a doorbell. It carries the subject and a link. Never the content. There is even an automated test that checks this: if somebody changes that piece one day, the test suite gets cross.

The second rule is simpler still: to close a ticket you have to write down how it was solved. The Solution field is required. This is not bureaucratic form-filling: it is the one ingredient that turns an archive into a memory you can consult. It is also why this knowledge base will not die after three months like every knowledge base in the world — there is nothing extra to fill in, the log is a by-product of work already done.

Three stages in one day

Foundations in the morning: a personal account for each technician, the list, the threads, the states. The doorbell in the afternoon: alerts over SMTP, and attachments — images and PDFs yes, video only as a link, because video fills shared hosting in an afternoon. The log in the evening: searching inside the solutions, filters by the version that carried the fix, printing a single ticket.

One detail that made me smile: the SMTP client is written by hand, a hundred lines or so that speak EHLO, STARTTLS and AUTH LOGIN. No library to install on the hosting. It is the same lesson learned with the licence server, when a well-regarded library refused to work and the answer was to use what PHP already has indoors. Fewer dependencies, fewer things that break by themselves over the August holidays.

The three times the tests saved me

I wrote 167 automated tests. Not out of diligence: because without them, three real defects would have gone into production.

The first: the path of the session cookie, which I had written by hand. It worked perfectly on the real site and broke in every test installation. A defect that would have shown itself only on the day somebody else tried to install it elsewhere.

The second, more serious: the attachments folder. These are files uploaded by technicians — screenshots of tills, of documents, with real data from real shops inside them. They have to sit outside the site, reachable only after signing in. In my test configuration they were not: you only had to guess the address. Now the module, when it creates that folder, writes a protection rule into it by itself — so even a misconfiguration exposes nothing.

The third is my favourite, for how silly it is: searching the log for three random symbols made the page fall over. The full-text engine was handed an empty term and the query died. No user would ever search for "%%%"... until the day one did.

Eighty-eight cases brought back up

The best part came last. An archive that is empty on day one is an archive nobody uses: whoever searches and finds nothing does not search a second time. So I went to fetch the history where it lived — two years of technical correspondence on Gmail — with a mail reader written for the occasion, which downloads only the messages matching a search and never leaves the machine.

Out came 88 conversations, 419 messages: 30 bugs, 22 requests, 36 improvements, from August 2024 to today. Each became a closed ticket, back-dated, with its solution attached.

Here too, two stumbles worth the notebook. The first attempt at reading the messages returned 77 empty bodies out of 88: Gmail wraps the text inside two nested levels of MIME structure, and my reader was looking only at the first. The second is funnier: the program looked for MyShop version numbers in the text and had found an odd one, "94.32.183". It was an IP address, quoted in a message about a sync gone mad. Four groups of digits instead of three: the computer cannot see the difference unless you explain it.

The result is that the log, on the day it was switched on, already had two years of memory inside it. Search for "voucher" and seven come out. Search for "gtin" and twelve. Search for "credit limit" and you find the case from June, with the answer I gave at the time.

One sign-in, and the licences in the same place

While we were at it, the old shared technical password went too: each technician now has their own account, and the same sign-in opens the manual, the reports and the log. The gain is not tidiness for its own sake — it is that a technician who leaves is deactivated with one click and loses access to everything, without having to change the password for everyone else.

And from the same place you get into the licence server without typing anything again, through a signed link that lasts two minutes and works once. With three things that link deliberately cannot do: it does not decide whether you are an administrator or a reseller (the licence server settles that), it does not skip the second factor, and it does not let a deactivated account in. Convenience, yes, but not at the expense of the locks.

The quotation that was owed

When I went through the correspondents to work out which technicians needed accounts, the program lined the conversations up oldest first. At the top sat the first email from Federico Secci, the technician who on his own opened 53 of the cases now in the archive.

The subject line read: "new procedure for handling requests and bug reports".

He had written it years ago, without knowing. Now it actually exists.

The real test starts on Monday, when the first report comes in. If something jars — an awkward step, an alert that does not arrive, a search that finds nothing — that will be the moment to put it right, while the habit is still new. Systems are not judged on the day they are switched on: they are judged on the day somebody, in a hurry, is tempted to write an email.