-
Notifications
You must be signed in to change notification settings - Fork 86
Fix notification & audit trail for dataclip retention policy changes #5089
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -641,7 +641,8 @@ defmodule Lightning.Projects do | |
| end | ||
|
|
||
| defp retention_setting_updated?(changeset) do | ||
| Map.has_key?(changeset.changes, :history_retention_period) or | ||
| Map.has_key?(changeset.changes, :retention_policy) or | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we didn't count changing the |
||
| Map.has_key?(changeset.changes, :history_retention_period) or | ||
| Map.has_key?(changeset.changes, :dataclip_retention_period) | ||
| end | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -228,7 +228,8 @@ defmodule Lightning.Projects.Project do | |
|
|
||
| defp maybe_validate_dataclip_retention_period(changeset) do | ||
| if get_change(changeset, :history_retention_period) || | ||
| get_change(changeset, :dataclip_retention_period) do | ||
| get_change(changeset, :dataclip_retention_period) || | ||
| get_change(changeset, :retention_policy) do | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quick question about this line. I was poking at what happens when someone changes only the policy and leaves the periods alone, and noticed the dataclip retention period gets cleared. That got me wondering what the nightly wipe does afterwards, since that period is the only thing it keys off. So I set up a project with a month of history and a week of dataclip retention, dropped in a record from ten days ago, and flipped just the policy to Then I went looking to see whether this was new, and mostly it isn't. If you change the policy at the same time as a period, or if a sandbox inherits Which makes me wonder whether we could leave it out of this PR and deal with the underlying thing on its own in a follow up issue, maybe having Could easily be missing something though, let me know what you think. |
||
| validate_dataclip_retention_period(changeset) | ||
| else | ||
| changeset | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This treats
retain_with_errorsthe same asretain_all, so now that a policy-only change sends the email, someone switching toretain_with_errorswould get a mail reading exactly like theretain_allone. Nothing to act on today, since that option is still commented out in the settings radio group.The reason I mention it at all is that the same gap shows up in the
save_dataclips?check inprojects.ex, which has no clause forretain_with_errorsand would raise on it. The TODO next to the commented-out option points at #1694, which is closed, so I'm not sure if that option is still on the cards. Either way it seemed worth knowing before anyone switches it on.