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

create Global switch for preserveDelete #96

Merged
merged 7 commits into from
Jun 28, 2024
Merged

create Global switch for preserveDelete #96

merged 7 commits into from
Jun 28, 2024

Conversation

nkaputnik
Copy link
Contributor

No description provided.

@nkaputnik
Copy link
Contributor Author

Hallo @Sv7enNowitzki
can you describe, where the code is that does the insert of the "Deleted" entry in this PR?
Also, how would the entry look like, so that I can update the readme file?

otherwise, this looks coprehensive, especially the test coverage...

@Sv7enNowitzki
Copy link
Collaborator

Sv7enNowitzki commented Jun 28, 2024

Hallo @Sv7enNowitzki can you describe, where the code is that does the insert of the "Deleted" entry in this PR? Also, how would the entry look like, so that I can update the readme file?

otherwise, this looks coprehensive, especially the test coverage...

Hi @nkaputnik ,

I should have provided a description in the PR, apologies for any confusion caused...

In this PR, the modifications specifically targeted towards the global switch functionality are reflected only in change-log.js. The behavior is as follows:

  1. When the user sets preserveDeletes to true, it signifies that all changelogs are retained when the root entity is deleted. Also, all changelogs for the delete operation are created and inserted into the change-tracking DB table.
  2. When preserveDeletes is set to false or not configured, all associated changelogs are deleted alongside the deletion of the root entity. This is our default behavior currently.

The code modifications made in entity-helper.js are for the purpose that the generated changelog is correct, aligns with our expectations when deleting the root entity. However, there was skewness in the ObjectID retrieval behaviors, and the code amendments in this file are directed towards fixing this bug.

Of course, if committing in this way is impractical, I can split and submit this as two separate PRs. Indeed, that seems more rational.

Best Regards,
Wenjun

@nkaputnik
Copy link
Contributor Author

No, that's good, I'll merge this PR and update readme and release notes...

@nkaputnik nkaputnik merged commit e26a0ce into main Jun 28, 2024
5 checks passed
@nkaputnik nkaputnik deleted the preserveDelete branch June 28, 2024 09:26
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