Skip to content

Conversation

@marcusmoore
Copy link
Collaborator

This PR fixes an issue where an incorrect timestamp would be written in the action log for accessory check-in via bulk check-in on users.

@what-the-diff
Copy link

what-the-diff bot commented Mar 11, 2025

PR Summary

  • Updated Logging Methods
    The methods 'logAccessoriesCheckin' and 'logConsumablesCheckin' have been updated. These changes are focused on the 'logAction' object. Instead of recording the time when the log entry was made, it will now show who created the entry. This provides better accountability and traceability of actions taken in the system.

@snipe
Copy link
Member

snipe commented Mar 11, 2025

Ignore the failing test - this seems like a test race condition and is unrelated.

@marcusmoore
Copy link
Collaborator Author

Ah yeah...that test is super flaky. I plan on working on making it more stable at some point.

Copy link
Member

@snipe snipe left a comment

Choose a reason for hiding this comment

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

I think we should pull the consumable checkin? We don't allow checkin anywhere else. Should be a delete if anything.

$logAction->target_id = $consumableUserRow->assigned_to;
$logAction->target_type = User::class;
$logAction->created_at = auth()->id();
$logAction->created_by = auth()->id();
Copy link
Member

Choose a reason for hiding this comment

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

We don't check in consumables though? Should we pull this method altogether?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks like this was carried over in #15221 from previous behavior but yeah...we don't actually check in consumables.

Do we want to purge the action log of existing consumable checkins? If so I think we should do another PR that includes removing this and the migration to do the purge...

I'm ok if you'd rather me just pull it from here too.

Copy link
Member

Choose a reason for hiding this comment

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

I’ll merge this one as-is, to fix the current issue, but I think another PR + migration should come soon after. To be clear though, deleting a consumable (FCO) is a recordable (loggable) event. Deleting the consumable join to a person shouldn’t be.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

10-4

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For reference: #16494

@snipe snipe merged commit 5e61a81 into grokability:develop Mar 12, 2025
9 checks passed
@marcusmoore marcusmoore deleted the bug/sc-28644 branch March 12, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants