Menu

Our send log counted every email twice because of "Z" vs. "+00:00"
📰

Our send log counted every email twice because of "Z" vs. "+00:00"

DEV Community: postgres·Galactic·10 days ago
#3lHi4Trw
#devtopostgresql#devto#dev#every#send
Reading 0:00
15s threshold

I build Galactic Outreach, a tool that finds local businesses and sends them a small, capped number of cold emails. This post is about a bug where a timestamp written two ways made every campaign think it had sent twice as much as it had. It also stopped every campaign at half its daily volume.

Two copies of the same campaign

The dashboard reads Postgres. The mailer, a Node script that does the actual sending, reads plain files: a CSV queue, a CSV send log and a do-not-contact list. That split is deliberate. The mailer is simple, runs from a CLI, and is easy to test against a temp directory.

But it means every campaign exists twice, and the two copies have to agree. Before every run, a step called hydration rebuilds the mailer's files from Postgres:

The queue and the batch are overwritten , even when the database copy is empty. If a lead was erased in the dashboard, a stale file must not still email them.

The send log and the do-not-contact list are merged.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.