Duplicate email or retry? Two different bugs in a Python intake workflow
Two form entries arrive with the same email address. One is a second delivery of the same submission. The other is a different request from the same person. If your automation treats both as duplicates, it throws away real work. If it treats every delivery as new, a retry creates the work twice. A unique email column does not tell these apart. All names and requests here are fictional. This is a…
The lab in question maintains every initial email delivery as raw input, with separate views for receiving, processing, and reviewing records. This separation ensures that the creation of review records is a distinct event from data receipt and processing. During a recorded run, the lab encountered two email deliveries from the same address: one that successfully processed and one that was replayed.
The system does not automatically merge these records, but rather presents them as separate entries labeled as "duplicate candidates." A failed receipt is generated alongside an existing derived record, not as an error but as a reflection of uncertainty during a recovery process. For instance, after a successful initial write and before an acknowledgment, a retry must handle this ambiguity without generating a second request.
The lab uses the email address as a key for record comparison, resulting in one retained row when duplicates are not allowed, or two rows when separate event IDs are used. The companion ZIP file provided contains the lab source, tests, and instructions to run the Python standard library code. An extraction into a fresh directory is recommended before executing the included tests, which will provide a final result rather than relying on scrolling test names.
It is important to note that the lab should not be used with real customer data and the database may retain invalid input values for educational purposes. The server should remain bound to the local machine to prevent unauthorized access.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to