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

fix: double delete events are handled correctly #341

Merged
merged 6 commits into from
Nov 3, 2023

Conversation

jamespfaulkner
Copy link
Contributor

@jamespfaulkner jamespfaulkner commented Nov 2, 2023

stream-registry PR

DefaultEntityViewUpdater to handle receiving double delete events correctly.

Details

The delete logic is slightly convoluted. Whenever we receive a delete event, we look up the original entity (if it exists) and keep a record of it so that agents are able to reconcile deletes using the last state of the entity prior to being deleted.

In some cases in the future, it might be required to "double send" deletes. E.g. a Delete event is sent for an entity that has already been deleted. Before this change, any subsequent delete event would cause the reference to the last state of the entity to be lost. Now it doesn't.

It's worth noting that in normal operations, when an agent is handling events on demand, this doesn't cause too many problems since the first delete event will be reconciled while the last known state of the entity is still available. However, this can cause problems for agents that are running scheduled reconciliation processes.

Changed

Now handles receiving the same delete event multiple times correctly.

PR Checklist Forms

  • CHANGELOG.md updated
  • Reviewer assigned
  • PR assigned (presumably to submitter)
  • Labels added (enhancement, bug, documentation)

@jamespfaulkner jamespfaulkner changed the title Fix/double delete events fix: double delete events are handled correctly Nov 3, 2023
@jamespfaulkner jamespfaulkner merged commit ae3a9d9 into master Nov 3, 2023
2 checks passed
@jamespfaulkner jamespfaulkner deleted the fix/double-delete-events branch November 3, 2023 13:51
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 this pull request may close these issues.

2 participants