When a new event is dispatched and the provided hash already exists, the endpoint returns constraint violation error. In some cases, with deterministic hashes, it would be useful to allow reusing existing events - this is now done using boilerplate code and checking for existing hashes.
Problems
Boilerplate code is needed to accommodate this functionality
Proposal
Add reuse=true flag to [POST] /api/events. If that is provided and conflicting hash is found, instead of creating a new event, the original one will be updated (description, summary, payload, status...) and its id returned.
Story
When a new event is dispatched and the provided hash already exists, the endpoint returns constraint violation error. In some cases, with deterministic hashes, it would be useful to allow reusing existing events - this is now done using boilerplate code and checking for existing hashes.
Problems
Boilerplate code is needed to accommodate this functionality
Proposal
Add
reuse=true
flag to[POST] /api/events
. If that is provided and conflicting hash is found, instead of creating a new event, the original one will be updated (description, summary, payload, status...) and its id returned.