Menu

1 / 2

The Save That Failed and Succeeded at the Same Time

DEV Community: javascript·Abhishek Kumar Dutta·about 1 hour ago
#tsObM8mJ
#devtojavascript#devto#dev#promise#rejection
Reading 0:00
15s threshold

Unhandled Rejections: The Silent Production Killer A Promise makes failure routable. It does not make it mandatory. A rejection nobody observes is not an error you see; it is an event you may or may not be listening for.

The bug report was one line: "It said Save failed, so I clicked Save again, and now everything is duplicated."

The screen was an admin tool for editing a customer account. One Save button, four writes: profile, preferences, billing contact, and an audit-log entry. The code fired all four in parallel with Promise.all . The audit-log endpoint had a bad deploy and returned a 500. Promise.all rejected on the spot, the UI showed a red "Save failed" banner, and the user did what any reasonable person would do. They pressed Save again.

The other three writes had already succeeded.…

Continue reading — create a free account

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