Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events: Reusable events #274

Open
martastain opened this issue Jul 17, 2024 · 1 comment · May be fixed by #310
Open

Events: Reusable events #274

martastain opened this issue Jul 17, 2024 · 1 comment · May be fixed by #310
Assignees

Comments

@martastain
Copy link
Member

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 martastain added the type: feature Adding something new and exciting to the product label Jul 17, 2024
@martastain martastain self-assigned this Jul 23, 2024
@martastain
Copy link
Member Author

  • reuse should be False by default to maintain the current behavior
  • in the API, it should be a query argument
  • in EventStream.dispatch, it should be a kw-only

@martastain martastain linked a pull request Aug 5, 2024 that will close this issue
@martastain martastain removed the type: feature Adding something new and exciting to the product label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant