4 ms·
Why not treat this the way a REST web service would? Request 1 submits token Request 2 submits token Response 2 returns first with a 409 conflict Response 1
by yesiamyourdad 12y ago
Why not treat this the way a REST web service would?
Request 1 submits token
Request 2 submits token
Response 2 returns first with a 409 conflict
Response 1 returns with a 200 OK
It's a question of handling the error codes properly. 409 means resubmit with a new If-Match. Other 400-series errors indicate some other problem with the client's submission.
Actually, if I were reviewing the original author's proposal, I'd say that double-click should be disabled only on <form method="post">
- mbell 12y agoThis has nothing to do with REST, the same issues exist.
- yesiamyourdad 12y agoWhat do you mean it has nothing to do with REST? It's an application built on HTTP. The same issues do not exist. Response 2 does not return "silent success" it returns 409 Conflict. The client can distinguish between conflict & success.
- mbell 12y agoThe error codes nor the transport are important here. You can make an arbitrary number of requests that can respond with various responses (or fail) in arbitrary order. Who do you listen to? Which response is 'correct'? Sure you can build a service on the client to track the requests, the order they are issued in, what responses supersede other responses, how long to wait for all responses, etc, etc. But why build such a complicated solution to such a simple problem?