Audit Events: Stop storing "Deleted User" as the user name
Problem to solve
Some AuditEvent
records have a user name of "Deleted User". That is due to this line in the code. However, it's not clear in exactly which circumstances that line is invoked. Preferably, that line should never be invoked. In other words, it would be better if we did not delete a user until we were finished creating AuditEvent
records for that user's actions.
Proposal
Always use the user name in AuditEvent
records, do not use generic user names like "Deleted User". This may require modifying application behavior to ensure AuditEvent
record creation is finished before a user is deleted.