Skip to content

audit: Two entries created for adding a auto-stop time of 1 hour #4317

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

Closed
sharkymark opened this issue Oct 3, 2022 · 3 comments · Fixed by #4513
Closed

audit: Two entries created for adding a auto-stop time of 1 hour #4317

sharkymark opened this issue Oct 3, 2022 · 3 comments · Fixed by #4513
Assignees

Comments

@sharkymark
Copy link
Contributor

Version: v0.9.1+27c8345

I added an auto-off setting to a workspace of 1 hour.

In the audit logs, it created 2 entries. The first entry does let me open it, to see the change.

Unfortunately it is in raw millisecond detail and not 1 hour like in the UI.

The unknown second audit log entry for this same event, cannot be opened.

image

@kylecarbs
Copy link
Member

@coadler why does this happen?

@kylecarbs kylecarbs added bug waiting-for-info The issue creator is asked to provide more information. labels Oct 3, 2022
@kylecarbs kylecarbs changed the title bug: 2 entries created in audit logs for adding a auto-stop time of 1 hour Two entries created in audit logs for adding a auto-stop time of 1 hour Oct 3, 2022
@Kira-Pilot Kira-Pilot self-assigned this Oct 10, 2022
@bpmct bpmct changed the title Two entries created in audit logs for adding a auto-stop time of 1 hour audit: Two entries created for adding a auto-stop time of 1 hour Oct 10, 2022
@Kira-Pilot
Copy link
Member

This is happening because we send down two requests when we update the workspace schedule form: 1) to /autostart, with an empty payload and 2) to /ttl with our updated auto-off. This is creating two audit logs, one without a diff.

There are a couple things we should do here:

  1. clean up that errant, empty API call on the FE
  2. only record diffs if they are actually diffs on the BE
  3. filter out audit logs with 0 diffs on the FE so that users don't see these old, nonsense records

Working on a PR for this now.

@Kira-Pilot Kira-Pilot removed the waiting-for-info The issue creator is asked to provide more information. label Oct 11, 2022
@Kira-Pilot
Copy link
Member

Turns out we may, in the future, have audit logs with empty diffs for valid use cases.

Therefore, we are only going to fix 1. in the above comment.

If anyone needs an audit log cleanup, we should delete invalid records for them. Shouldn't be an issue as audit logs have only been enabled on our deploy.

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.

3 participants