neuroforgede / nfcompose

Build REST APIs/Integrations in minutes instead of hours - NF Compose is a (data) integration platform that allows developers to define REST APIs in seconds instead of hours. Generated REST APIs are backed by postgres and support automatic consumer webhook notifications on data changes out of the box.
Mozilla Public License 2.0
33 stars 3 forks source link

Should POST to datapoint (no upserts) throw errors on concurrent modification #56

Open s4ke opened 11 months ago

s4ke commented 11 months ago

Currently, the last POST silently wins when two start at a time where no entry exists because we are simply using the standard upsert logic. While this is good for most cases, this might be surprising in some situations.

Instead, we could simply remove the ON CONFLICT logic when doing a regular POST.

s4ke commented 11 months ago

We can handle such a race condition that was not handled by the validation logic by returning a HTTP 409 conflict.