Skip to content

Change history #98

@mikedawson

Description

@mikedawson

Jenkins Status

As a user I want audit logs so that I can see a history of any data changes and who made the changes.

User flows:

  • User wants to see the history of changes made (any data they have access to) on learning units (lessons, assignments, playlists), class, person, enrollment, content Metadata.
  • Each change line needs to include the date and time stamp, who made the change/person name, previous value, and new value.

Prototype here

Behavior notes:

  1. Draft descriptions for change descriptions (initial version as from Slack):

PERSON:
When created: Created (First name = 'bob, Last name = 'Jones', Gender='Male', Username = ) show the value of each field
When modified: Changed (First name from 'Bob' to 'Robert'): list each field that has changed with the new value and the old value
When deleted: Deleted (First name = 'bob, Last name = 'Jones', Gender='Male', Username = '): show the value of all fields as it was when deleted 

CLASS (including enrollment changes): 
When created/modified: same behavior as per person
When student or teacher enrolled : (Student/teacher) enrolled : (First name = 'Bob', Last name ='Jones' username = 'username', start date = 09/Mar/2026): Show role, then the student/teacher's first name, last name, and username. 
When enrollment modified: Enrollment modified for First name = 'Name' Last name = 'Name', username='username': Changed (Start date from 09/Mar/2026 to 01/Mar/2026)
Enrollment requested: First name = 'Bob', Last name ='Jones' username = 'username', start date = 09/Mar/2026)
Enrollment <approved/rejected>: First name = 'Bob', Last name ='Jones' username = 'username', start date = 09/Mar/2026)

Playlist removed until this functionality is available in main branch.

Implementation notes:

  • The logic to determine changes should go in the store function. The store function can find the previous version (if any). Then generate a ChangeHistoryEntry:
table:
uid:
timestamp:
who:
changes: [
   field: id/enum (e.g. id for first_name, last_name etc).
   newVal: (string)ing sent.
   oldVal: (string?)
]
  • The function that sends to server (DrainRemoteWriteQueue) : needs to look for change history entries for the data being sent. The change and the ChangeHistoryEntry must go at the same time in the same request to the server. There may be multiple ChangeHistoryEntry(s) to send for a single piece of data if multiple changes were made offline.
  • there will be need to be functions that generate a ChangeHistoryEntry given two entities (the current one, and the new one).
  • Expected: The ChangeHistory will have a datasource that will be read-only : so changes made can be retrieved as normal, but storing them is done only by the other relevant datasources (e.g. Person, Class, etc).
  • Permissions: permission to see the change history should be the same as seeing the entity itself e.g. if you can see the person, you can see the change history of the person. If you can't see the person, you can't see the change history for that person.

Metadata

Metadata

Assignees

Labels

P1High priority issuePrototypeReadyHas clear and unambigous prototype sufficient for end-to-end test development and software itself.ReadyForPrototypeHas a user story and list of tasks that user should be able to complete.

Type

No type
No fields configured for issues without a type.

Projects

Status
In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions