HarperFast / HarperFast/studio
e2e: Mailosaur deleteAllMail() is server-wide and can delete a concurrent run's verification email
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 4
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 40
Description
Found during the adversarial review of the e2e suite; not addressed in #1572.
`tests/mail.ts` → `deleteAllMail()` calls `client.messages.deleteAll(serverId)` from `afterAll`, which deletes **every** message on the Mailosaur server, not just the ones this run generated.
That was safe when one lane ran at a time. It no longer is:
- the trusted lane (daily + 15-min stage poll) and the PR lane can overlap — `host/run-sandbox.sh` explicitly notes both drive it;
- a local `pnpm test` on a developer machine uses the same Mailosaur server.
If one run's `afterAll` fires while another is inside `waitForVerificationEmail()` (a 90s window), the second loses its message and fails with "No verification link found" — an unreproducible red that triage will most likely classify as a regression.
Fix ideas:
- Delete only messages addressed to the address this run generated (`client.messages.list({ sentTo })` → per-id delete). Addresses are already unique per run, so that is sufficient.
- Or give each lane its own Mailosaur server and keep the server-wide purge.
Contributor guide
Research direction
Start in tests/mail.ts with deleteAllMail() and trace how sentTo is generated and used by waitForVerificationEmail(). Review host/run-sandbox.sh for the overlapping trusted and PR lanes. Done means cleanup removes only this run's messages, while another concurrent run can still retrieve its verification email; add or run the relevant e2e coverage if the existing suite exposes it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100