I like your posts and you're doing a great job but your "SQL INSERT ... ON CONFLICT" is not idempotent and will in fact continue to update stock on each conflict - from the 3rd try - assuming it didn't exist on the 1st try OR from the 2nd try - assuming it did exist on the 1st try.
Idempotency is underrated and under-implemented.
Too many systems lack the ability to safely handle retries, turning simple issues into complex failures.
Thanks for sharing this, Ashish!
Just curious. If the user is refreshing and starting again then the backend should be aware it's another handshake not so sure here whole picture.
Hi
I like your posts and you're doing a great job but your "SQL INSERT ... ON CONFLICT" is not idempotent and will in fact continue to update stock on each conflict - from the 3rd try - assuming it didn't exist on the 1st try OR from the 2nd try - assuming it did exist on the 1st try.
:^)