Skip to content

Audit log UI offers Entity filters that can never return a result #1473

Description

@joshunrau

Summary

/admin/audit/logs offers Entity filter options for entities nothing ever writes an audit log for, so those filters are guaranteed dead ends.

Detail

The Entity filter offers GROUP, USER, INSTRUMENT, INSTRUMENT_RECORD, SESSION and SUBJECT. But AuditLogger.log() is called from exactly two services in apps/api:

  • assignments.service.tsCREATE / UPDATE on ASSIGNMENT
  • auth.service.tsLOGIN on USER

Creating, updating or deleting a Group, User, Instrument, Subject or InstrumentRecord is never audited. Selecting any of those filter values always returns an empty table, which reads as "nothing happened" rather than "this is not recorded".

Suggested fix

Either add the missing AuditLogger.log() calls (the substantive fix — related to #194), or restrict the filter's options to the entities actually audited so the UI stops promising coverage that does not exist.

Notes

Found while writing the Playwright suite (branch e2e-tests). testing/src/specs/admin-audit-logs.spec.ts can only exercise the Login filter for this reason.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions