29th / personnel-v3

Personnel management system version 3
https://www.29th.org
2 stars 6 forks source link

Consider caching enlistment analysis data #248

Open wilson29thid opened 6 months ago

wilson29thid commented 6 months ago

Currently, when an enlistment liaison views an enlistment from /manage/enlistments/xxx, the following information is fetched on page load:

It involves 3-6 network requests every time the page loads, which is clearly a bit silly, and is the reason those pages are a bit slow.

We could speed it up dramatically by fetching that information once and saving it in the database. Perhaps we fetch it when the person enlists, and save it in the enlistment record?

The question then, is from an MP security perspective. For example, if a user enlists and then creates a new discourse account (with the same IP address), that new discourse account wouldn't show with this approach. Or if they enlist and then start using the forum with a new IP address, which is linked to other users, those linked users won't show. But maybe that's okay? Like, is that scenario realistic? Theoretically we could implement a refresh button, but then we'd expect liaisons to click that every time anyway, which kind of brings us back to where we are today.

Thoughts, @conrad29th @swomma ?