The Real Fullstack

The Duplicate Form Submission

We disabled the submit button. Why do duplicate tickets keep appearing?

エクスプローラー6 分フローシミュレーターコード課題
angularrxjshttpvue

この課題はまだ日本語に翻訳されていません。英語版を表示しています。

ミッション:Guarantee one ticket per form submission under double clicks, timeouts and slow databases — while still retrying so customers aren't left guessing.背景 · 学習目標 ▾

Larkspur's support form creates a ticket and sends a confirmation e-mail. Some customers double-click; others are on flaky mobile networks where the HTTP client retries after a timeout. Duplicates confuse agents and annoy customers.

ミッション: Guarantee one ticket per form submission under double clicks, timeouts and slow databases — while still retrying so customers aren't left guessing.

学習目標

  • Distinguish UI-level guards from server-side idempotency.
  • Use exhaustMap / disabled states for user experience.
  • Send an idempotency key that survives retries.
シミュレーションシミュレーション値
Support formAPITicket serviceTickets DBConfirmation e-mail
シミュレーションを実行
submit() {  this.http.post('/support-tickets', this.form.value).subscribe(() => this.done());}

簡略化

Three failure switches. The server side reuses the idempotency model from The Duplicate Payment. 教育用モデルです。数値は挙動を示すためのもので、ベンチマークではありません。

コンセプト

関連する課題

参考資料