Menu

1 / 4

The Second Click Charged Them Twice

JavaScript in Plain English - Medium·Prayush Jain·15 days ago
#7AU7cCi3
Reading 0:00
15s threshold

Member-only story

The Second Click Charged Them Twice

Prayush Jain

6 min read7 hours ago

The request worked. The user couldn’t tell. So they clicked again.

Press enter or click to view image in full size

Pay button. User taps it. The spinner is tiny, or the network is bad, or they’re in a lift, and the screen sits there. They tap it again.

Both requests were valid. Your handler ran the charge twice. No exception, no red test, nothing in the logs that looks like a bug. The customer still got billed twice, and they’re the one who has to notice.

Most fetch examples stop at one call and one response. That's the demo.…

Continue reading — create a free account

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