Skip to content

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

Closed

Description

@sharkymark

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

Activity

  1. kylecarbs commented on Oct 3, 2022

    @kylecarbs
    Member

    @coadler why does this happen?

  2. 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[/+] on Oct 3, 2022
  3. self-assigned this
    on Oct 10, 2022
  4. 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[/+] on Oct 10, 2022
  5. Kira-Pilot commented on Oct 11, 2022

    @Kira-Pilot
    Contributor

    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.

  6. removed
    waiting-for-infoThe issue creator is asked to provide more information.
    on Oct 11, 2022
  7. Kira-Pilot commented on Oct 14, 2022

    @Kira-Pilot
    Contributor

    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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions