Distinguish Duplicate Events from Legitimate Repeat Requests in Tests
Prepared with AI assistance by Alactic Editorial. Examples identified as hypothetical are illustrative, not customer results.
A customer submits a service request, receives help, and submits the same request again later. A duplicate-prevention rule recognises the matching details and discards the second submission. The rule may block accidental retries correctly while still losing this customer's new request.
Test that distinction with pairs: one accidental replay and one independently initiated occurrence containing similar information. Define the expected decisions first, then check the resulting work. Preventing an extra effect and preserving a genuine request are separate requirements.
This method tests occurrence-level decisions. It does not cover contact deduplication, identity merging, or implementation of event identifiers. The workflows and artifacts below are recommended test designs, not claims about controls available in a particular product.
1. Define the occurrence and the suppression contract
Start with the business action being recognised: a request for help with an incident, an inspection for a service cycle, or a request for a new quotation. Matching sender details and wording do not necessarily mean matching occurrences.
Write a decision contract with three categories:
- Same occurrence: another presentation of an already recognised request, such as a retry after an uncertain acknowledgement.
- New occurrence: a separately initiated request, even when its content matches an earlier request.
- Uncertain relationship: evidence is insufficient; use an agreed review path or another explicitly documented disposition.
Define the required business effect too. Accepting a new occurrence might create a service item, attach a distinct request to an existing case, or request authorisation. It need not create a new top-level record or automatically execute an external action. A genuinely new request still has to pass applicable permission and eligibility checks.
Finally, specify the suppression horizon and available history. If replay recognition is supported only while occurrence evidence is retained, do not test indefinite recognition as an unstated requirement. Record what happens after that evidence expires: review, processing under a bounded contract, or another agreed outcome. A documented limitation is not equivalent to proof that old replays are safe.
2. Build pairs that isolate the intended distinction
Testing only identical replays proves too little. A rule that rejects every similar request could pass those tests while blocking legitimate work.
Within each pair, keep visible request details as similar as practical. Change the evidence establishing whether the arrival belongs to an existing occurrence or a new one. Useful distinctions include a fresh incident, different equipment, a new service cycle, or explicit confirmation of a separate need.
Record how the test establishes that relationship independently of the rule being tested. For example, a fixture can identify a submission as a replay of an earlier test occurrence. A separate fixture can represent an independently initiated request for another incident. Do not use the workflow's own duplicate label as the ground truth.
Elapsed time is context, not a universal answer. A new occurrence can arrive immediately; a replay can arrive much later. Lifecycle state matters too: completed work does not rule out a fresh need, and open work does not prove that every similar arrival belongs to it.
3. Reusable filled comparison artifact
Hypothetical worked example: An equipment service team records each accepted inspection occurrence in a traceable service item, subject to normal authorisation. All cases and expected outcomes below are fictional. Suppression means preventing an additional business effect, not erasing evidence of the arrival.
The table uses two columns so each scenario can be read without a wide comparison grid. Copy it into a test document and replace the incident, equipment, and service-cycle distinctions with those used by your workflow.
| Case and arrival context | Expected outcome and evidence to inspect |
|---|---|
| A — Replay after uncertain acknowledgement. The original service item already exists. | Prevent another item. Inspect the original item and the replay disposition; a second item indicates an extra effect. |
| A — New incident later that day, independently submitted with identical inspection wording. | Record a separate occurrence. Linking only to the earlier item without representing the new incident indicates improper suppression. |
| B — Original submission replayed after its service item was completed. | Do not repeat completed work. Check for a new item or repeated downstream effect. |
| B — Fresh equipment fault after completion; the customer requests the same inspection. | Accept new work. Discarding it because matching work was completed indicates improper suppression. |
| C — Two copies of one submission arrive almost together. | Produce one intended effect. Inspect the settled state for delayed extra work. |
| C — Independently submitted requests for two pieces of equipment use identical wording. | Represent both occurrences. A queue containing only one equipment request indicates missing work. |
| D — Old replay after the rule's suppression history expires. | If a retained occurrence ledger still proves prior completion, apply the agreed historical-replay rule. If that evidence has also expired, expect documented review or processing under the bounded contract—not universal suppression. |
| D — New periodic inspection for the next service cycle, with matching details. | Accept the new cycle. A duplicate decision based only on matching earlier content indicates improper suppression. |
| E — Delivery retry while the original service item remains open. | Prevent an extra item. Preserve a traceable disposition for the retry. |
| E — Customer confirms a separate incident while the first remains open. | Accept or explicitly review the separate incident. Treating open work as proof against any new incident is a failure. |
| F — Replay after partial processing: the service item exists, but a later internal step failed. | Recover only unfinished work. Inspect completed effects for repetition and the failed step for recovery. |
| F — Independently initiated matching request arrives while recovery is pending. | Assess it separately. Absorbing it into the earlier occurrence without its required processing or review indicates improper suppression. |
For pair D, record the actual retention setup in each run. Test both retained historical evidence and expired evidence if both states are supported. When no historical evidence remains, known replay status exists in the test fixture but may be unavailable to the workflow. Judge the workflow against its agreed contract, while reporting any repeated effect as a remaining business risk.
4. Run each side from an independent baseline
Use an isolated test environment, with external effects disabled or routed to approved test destinations. Check which controls and observations are available in the relevant workspace and current plan; do not assume web and mobile surfaces expose identical functions.
Run each side of a pair separately. Presenting the replay and then the new request in one default sequence can change the state being tested.
- Prepare a baseline fixture. Submit the original occurrence if needed, then explicitly move it into the required lifecycle state: open, completed, or partially processed. Verify which effects have completed.
- Capture the baseline. Record relevant items, occurrence history, pending work, authorisation state, and retained evidence. Include the clock or retention setup where relevant.
- Run the replay side. Restore that baseline, present only the accidental repeat, and observe its decision and effects.
- Run the legitimate side. Independently restore the same baseline, present only the new occurrence, and observe its decision and effects.
- Compare against separate expectations. Do not let one side's result redefine what the other side should do.
For pair C, prepare an empty baseline for each side. One run receives two copies of one occurrence; the other receives two independently initiated equipment requests. Neither run inherits records from the other.
Mixed-arrival, reversed-order, and overlapping-processing runs are additional tests. Introduce them after the isolated comparison so any failure can be distinguished from contamination by an earlier arrival.
5. Work through partial failure with observable evidence
Hypothetical worked run for pair F: The baseline contains service item S-41 for incident I-41. Item creation succeeded, but an internal assignment step failed. The test ledger records creation as completed and assignment as unfinished.
In the replay run, restore that baseline and replay the original submission. The expected result is still one service item for I-41, with the unfinished assignment recovered through an authorised path. A second service item fails the repeated-effect check. No recovery and no actionable disposition fails the recovery check.
For the legitimate run, restore the baseline again. Submit a separately initiated request for incident I-42 with the same inspection wording. The expected result is a traceable I-42 occurrence, either accepted or placed into the agreed review path, while I-41 retains its own recovery state.
Suppose the observed result is a duplicate label linked to S-41, with no representation of I-42. That is evidence of improper suppression if the decision record confirms the duplicate classification caused the omission. First exclude other causes: failed validation, missing authorisation, queue delay, or downstream failure.
A useful result entry records the input relationship, baseline, expected decision, observed decision, associated work, completed effects, and evidence location. Counts alone are insufficient: one lost request and one accidental extra item can leave the total unchanged. Likewise, a success acknowledgement does not prove the required work exists.
6. Probe boundaries without changing everything at once
After the basic pairs, vary one condition at a time. This makes failures easier to explain and avoids confusing several changes with one causal signal.
- Suppression boundary: test a replay and a new occurrence just before, at, and after the agreed boundary. State which historical evidence remains available at each point.
- Formatting: replay an occurrence with cosmetic changes, then submit a new occurrence with exactly matching text. Record which changes affect meaning.
- Lifecycle: repeat relevant pairs while original work is open, completed, cancelled, or recovering.
- Processing order: vary submission and processing order separately where the environment allows it.
Define an observation period suitable for the test environment. An immediate refresh can miss delayed extra work or an arrival left pending. If processing has not settled by the agreed observation point, classify the result as unresolved rather than assuming success.
Keep identity questions outside this exercise. Shared contact details do not establish one occurrence, and different contact details do not prove separate occurrences.
7. Specify recovery for both failure directions
An accidental repeat that creates extra work needs a controlled way to stop or reconcile the extra effect. A legitimate request that was suppressed needs authorised restoration without indiscriminately replaying all earlier work.
For the latter, name the reviewer, the evidence needed to establish a separate occurrence, and the permitted correction. Preserve the original disposition and correction together. For partial failures, distinguish completed effects from unfinished ones before approving recovery.
Review is not a free solution. It adds handling time and workload. A proposed review path needs an owner, visible status, and a resolvable outcome; an unmonitored queue can lose work as effectively as rejection.
If bounded history permits old replays to be processed, document that residual risk and the reconciliation procedure. If the risk is unacceptable, the contract or evidence-retention design needs revision before the test can establish readiness.
8. Use a short release checklist
- Every pair has independently restored baselines and agreed expected outcomes.
- Retention-dependent cases identify available evidence and documented limitations.
- Results separately report extra effects, improperly suppressed occurrences, and unresolved arrivals.
- Recovery has been demonstrated for missing work and partial failures.
- Changed rules have been checked against both sides of affected pairs.
Passing supports release for the agreed scenarios; it does not prove that every future arrival will be classified correctly.
Put the next conversation to work.
Explore Alactic Communications for WhatsApp conversations, campaigns and AI-assisted workflows. Choose the product and plan that fit your team.
Explore Communications