momentumfrc / attendance-manager

Keep track of the attendence of our team members by allowing mentors to check students in and out.
0 stars 0 forks source link

Improve student caching #59

Closed lost1227 closed 11 months ago

lost1227 commented 11 months ago

Currently, we retrieve the whole list of students from the backend pretty frequently. However, since this list includes soft-deleted students, this is starting to use a significant amount of data.

This story is to implement two fixes:

  1. Only include deleted students in the student request if the client has explicitly asked to include deleted students. This should only occur if the client is in the "list students" page and enables "show deleted".
  2. Cache the student list forever, and optionally add student events to the poll endpoint.
lost1227 commented 11 months ago

While (1) says to only request deleted students on the list students page, this logic is faulty and was not implemented. This is because we want to include deleted students in the unique name validator when adding new students.

The less error-prone approach is to always include deleted students, unless the component decides it's okay to exclude them. So far, the only component which specifies this is the add-attendance-event component.