-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for removal of "pending" source accounts #6488
Comments
Today @nathandyer and I mapped out the following approach for implementing this lever:
|
Reviewed directly on 07a5892, @nathandyer. :-) |
Perfect, thank you so much for that feedback @cfm! Glad to know I'm on the right track. Will take another swing at this in the morning. |
@cfm I've added some new changes which should address the issues you found in the first commit, please feel free to take a look when you have a moment. I will note that I still haven't tested these changes first-hand, I'm getting an error on two different machines when I try to directly call the script (I suspect I have newer packages than I'm supposed to and something got deprecated - will continue to troubleshoot). |
@nathandyer and I paired on this again today, through which we have a working
|
Per securedrop.models.Source, "sources are 'pending' and don't get displayed to journalists until they submit something". Preserve that behavior by deferring pending=True to record_source_interaction(). In the context of #6488, the test plan should check something like: $ ./loaddata.py [...] $ ./manage.py remove-pending-sources --keep-most-recent 0 Found 0 pending sources Deleted 0 pending sources $ ./loaddata.py --messages-per-source 0 --files-per-source 0 --replies-per-source 0 [...] $ ./manage.py remove-pending-sources --keep-most-recent 0 Found 3 pending sources Deleted 3 pending sources
Per securedrop.models.Source, "sources are 'pending' and don't get displayed to journalists until they submit something". Preserve that behavior by deferring pending=True to record_source_interaction(). In the context of #6488, the test plan should check something like: $ ./loaddata.py [...] $ ./manage.py remove-pending-sources --keep-most-recent 0 Found 0 pending sources Deleted 0 pending sources $ ./loaddata.py --messages-per-source 0 --files-per-source 0 --replies-per-source 0 [...] $ ./manage.py remove-pending-sources --keep-most-recent 0 Found 3 pending sources Deleted 3 pending sources
Description
When a source account is created but before a first submission, by default a "pending" flag is set. Pending accounts are not displayed in the journalist interface.
If a user then exits their session and never returns to provide a submission, the account will remain in a pending state indefinitely, and cannot be removed via the Journalist Interface. On long-running high-volume instances this increases the source user count significantly, requiring admin intervention to fix.
One approach to allow for the removal of unused source accounts would be to change the
pending
boolean flag to a datetime value, and purge unused accounts via a cronjob or similar after a set time (say, a month). This has the disadvantage of increasing metadata (source account creation time) about prospective sources, though the field could be set tonull
on submission, meaning that said metadata would not be stored for sources that were actually ever active. This could be mitigated somewhat by giving the datetime a resolution on the order of days or weeks.Alternatively, the fact that active source sessions without submissions would be nuked when the purge ran could just be accepted.
Note that this would be moot if/when inverted flow changes land, as accounts would then only be created on first submission. So it might not be worth the effort if it was just a temporary measure.
To do
manage.py
command--keep-most-recent
's offset logicUser Research Evidence
long-term observations of instance behavior...
User Stories
The text was updated successfully, but these errors were encountered: