Menu

Your Save Button Just Overwrote Someone Else’s Work
📰

Your Save Button Just Overwrote Someone Else’s Work

DEV Community: api·Ankit Jain·1 day ago
#WoZoHc6b
#devtoapi#devto#dev#flag#description
Reading 0:00
15s threshold

Say Ela opens the fast checkout flag to fix a typo in its description. The form loads a 10% rollout. While she’s editing, Sami raises it to 25% from another tab.

Ela clicks Save. She touched only the description, but the form sends the whole flag, including the old 10%. If the API accepts that request as-is, it puts the rollout right back where it started. Ela sees her typo fixed. Sami has no reason to think his change disappeared.

If I’m reviewing that save flow, I want to see what happens when the form has been open long enough for someone else to make a change. Can Ela keep her edit without undoing Sami’s?

Attach the version to the edit

The console reads GET /flags/fast-checkout . The API returns a representation and an ETag :

HTTP / 1.1 200 OK Content - Type : application / json ETag : "flag-7"

{ "description" : "Enable fast checkout" , "rollout" : 10 }

Enter fullscreen mode

Exit fullscreen mode

When Ela saves, the console sends the tag from that original read.…

Continue reading — create a free account

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