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

Need separate events for input stopped and input deleted #7812

Open
waab76 opened this issue Apr 1, 2020 · 0 comments
Open

Need separate events for input stopped and input deleted #7812

waab76 opened this issue Apr 1, 2020 · 0 comments

Comments

@waab76
Copy link
Contributor

waab76 commented Apr 1, 2020

Expected Behavior

When an input is stopped either by the user or due to an error (deleted from the InputRegistry), an InputStopped event should be propagated by the EventBus.

When an input is deleted (deleted from the InputStateService), an InputDeleted event should be propagated by the EventBus

Current Behavior

Currently, an InputDeleted event is propagated by the EventBus in both cases (input stopped and input deleted). This makes it impossible for components to react to one event type but not the other.

Context

For a new Input with persistent state stored in MongoDB, I would like to delete the MongoDB record when the Input is deleted, but retain the MongoDB record when the input is stopped. This is currently impossible because both state transitions emit the same event type.

@waab76 waab76 added the bug label Apr 1, 2020
@bernd bernd added the triaged label Apr 6, 2020
bernd added a commit that referenced this issue Apr 28, 2020
This is a workaround for the problem described in #7812.

When we receive an "InputDeleted" event, check if the input still exists
in the database. If so, the input has only been stopped and we don't
want to delete our state.

Refs #7812
@bernd bernd added this to the 4.0.0 milestone Apr 28, 2020
@bernd bernd added the inputs label Apr 28, 2020
@bernd bernd removed this from the 4.0.0 milestone Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants