Urgent.News

What's breaking now, across hundreds of outlets.

Tech

The booking was saved, but the customer saw an error: email after commit in Next.js

This bug made it into the released versions of my Next.js 15 templates (two booking sites, a barbershop and a dental clinic, and two small online stores). All the tests were green. The booking flow had a row lock, an idempotency key and a race test. And it could still book the same customer twice. Here's the flow it broke: The customer submits the form. The appointment is committed to Postgres.…

In the release of Next.js 15 templates, a bug caused customers to receive duplicate bookings. The email notification after form submission sometimes failed, despite the appointment being saved to the database. This resulted in customers seeing an error and the system marking the booking as successful. To address this, the author implemented several fixes.

First, the email sending function sendMail was modified to return false instead of throwing an exception upon failure, allowing the system to log the error without causing a booking failure. Second, the book() function was updated to include a separate try/catch block for any code running after the appointment is saved, ensuring that any post-commit errors do not alter the booking status.

This change was applied similarly to the Stripe webhook, where the email sending step was isolated in a try/catch block to prevent the webhook from returning an error. Finally, the UI displayed the correct email status, informing users whether their confirmation email was sent or not, even if the SMTP server was down. This set of changes aimed to prevent the occurrence of duplicate bookings caused by email failure, improving the overall user experience.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

More from Dev.to on urgent.news

Get the news by email. Yesterday's most-covered stories, every morning.

See today's edition · More options

More in Tech

jq --arg vs --argjson: keep build ID 001 from turning into 1

The shell hands a release job two strings: the build ID 001 and the dry-run setting false . The manifest needs to keep the first as text and turn the second into a boolean.

  • "001" build ID kept as text using --arg flag
  • "false" dry-run flag converted to JSON boolean
  • jq 1.7 change causes ID to print as number 1

A Chart Is Four Systems in a Trench Coat

A Chart Is Four Systems in a Trench Coat go-pptx Tech Blog · Part 5: The Chart Subsystem — From Restricted Types to Combo Charts and Embedded Workbooks Series: go-pptx Tech Blog (10 parts) Baseline…

  • Altering one layer causes inconsistencies when opening the chart in PowerPoint
  • Go-pptx treats chart as restricted subsystem with explicit contract between Input and Output

Auto-Narration Without FFmpeg

Auto-Narration Without FFmpeg go-pptx Tech Blog · Part 6: Media, Playback Timing, and Auto-Narration — A Pure Go Approach Without FFmpeg Series: go-pptx Tech Blog (10 parts) Baseline: v2.4.4 Keywords…

  • Auto-narration achieved via pure Go without FFmpeg
  • WAV files analyzed by reading fmt block details
  • MP4 and WebM durations marked as DurationUnknown

More from Sunday, 6 December 2026 →