why do websites, where you buy stuff, still need that “don’t use the browser back button to click away when you are making a purchase”. Have we not got a better solution?

261 views

why do websites, where you buy stuff, still need that “don’t use the browser back button to click away when you are making a purchase”. Have we not got a better solution?

In: 52

12 Answers

Anonymous 0 Comments

There are better solutions, and they’re likely being used with the warning left just because it’s easier that way.

The idea is called idempotency, which is a fancy word that just means doing a thing multiple times works the same as if you only did it once. For example, setting your phone’s background to a particular image is idempotent – you can change your background to that image again and again, and it won’t be any different than if you did it once.

Idempotency is a big deal in computers because things go wrong and it’s important to be able to try them again when they do. But, sometimes certain things just aren’t easy to make idempotent – sending an email, for example, is really tricky to make idempotent. If there’s an error sending the email, does that mean it got sent? Did it not?

A common solution to this is what’s called an idempotency key. It’s usually a random series of letters that should only ever be used once. So for example with the email, what you could do is decide ahead of time with the person that you’re sending the email to that any emails with the same idempotency key as a previous email should be ignored. That way, if sending the email gets an error you can try sending the same email again with the same idempotency key, and be confident that only one email will be seen by the person you’re emailing – if both emails actually go through, one will just get ignored.

The trouble with this, though, is maybe it’s slow or expensive to send those emails. There’s a lot of processing and double checking that needs to be done, so even if the recipient won’t get two it’s still a waste of time to send a second email if you don’t need to.

That’s likely what’s happening with those pages that warn not to press back while making an order – if they’re designed well they should have checks in place to try to make sure the order is idempotent, but they probably still have that warning because even if things don’t break it likely still slows their stuff down having orders done twice when they don’t need to be.

You are viewing 1 out of 12 answers, click here to view all answers.