ynput / ayon-backend

Server codebase with API access to AYON
Apache License 2.0
22 stars 15 forks source link

Events: Reusable events #274

Open martastain opened 3 months ago

martastain commented 3 months ago

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.

martastain commented 3 months ago