Skip to content

fix: duplicate workspace update entries - #4513

Merged
Kira-Pilot merged 6 commits into
mainfrom
workspace-update-logs-twice/kira-pilot
Oct 14, 2022
Merged

Kira-Pilot merged 6 commits into
mainfrom
workspace-update-logs-twice/kira-pilot

Conversation

@Kira-Pilot

@Kira-Pilot Kira-Pilot commented Oct 12, 2022 •

Copy link
Copy Markdown
Contributor

resolves #4317

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

This PR fixes the following

  • cleans up that errant, empty API call on the FE
  • makes sure the BE only creates log entries if there are actually diffs
  • filters out audit logs with 0 diffs on the FE so that users don't see these old, nonsense records

Before
Screen Shot 2022-10-12 at 9 37 32 AM

After:
Screen Shot 2022-10-12 at 9 37 11 AM

@Kira-Pilot
Kira-Pilot requested a review from a team as a code owner October 12, 2022 14:19
@Kira-Pilot
Kira-Pilot requested review from BrunoQuaresma and removed request for a team October 12, 2022 14:19
@github-actions

github-actions Bot commented Oct 12, 2022 •

Copy link
Copy Markdown
Contributor

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@Kira-Pilot

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@Kira-Pilot

Copy link
Copy Markdown
Contributor Author

recheck

@Kira-Pilot
Kira-Pilot requested a review from coadler October 12, 2022 15:05
Comment thread coderd/audit/audit.go Resolved

@BrunoQuaresma BrunoQuaresma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Kira-Pilot
Kira-Pilot merged commit dd8ebf1 into main Oct 14, 2022
@Kira-Pilot
Kira-Pilot deleted the workspace-update-logs-twice/kira-pilot branch October 14, 2022 18:39
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants