fix(auth): GitHub-only accounts go 30 days after GitHub's end, on the register alone, one failure holding back none

The reading of the full reading's fixes found that a member, which keeps
no addresses, would delete everyone it holds with a GitHub ID as if
GitHub were their only way in (D1); that each deletion delivered every
pending notice, so with a member hanging the daily run grew quadratic,
and one failing person aborted it, forgetting no GitHub ID (D2); and that
a GITHUB_SIGN_IN_ENDS set wrong deleted data at the next daily run.

forgetGitHubAccounts now does nothing on a member and waits 30 days after
the end (gitHubAccountsKeptAfterEnd), keeping the accounts and IDs while a
wrong date can be put right; deletes each GitHub-only account on its own,
a failure logged by type, that person's GitHub ID kept for the next run;
and tells the members once, after all of them (deletePerson's tellMembers).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-21 16:05:57 +02:00
commit f9880e6989
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
2 changed files with 180 additions and 24 deletions

View file

@ -11,8 +11,9 @@ import 'package:serverpod/serverpod.dart';
/// All but the last are halkyon_base's (ADR 0014, ADR 0016), and people go
/// through its `deletePerson`, so Learn's own data of theirs goes too.
class PruningFutureCall extends FutureCall {
/// Prunes one batch and logs how many people went; once GitHub sign-in
/// has ended (`GITHUB_SIGN_IN_ENDS`), forgets every GitHub ID too; and
/// Prunes one batch and logs how many people went; 30 days after GitHub
/// sign-in ended (`GITHUB_SIGN_IN_ENDS`), deletes the accounts that had
/// no other way in and forgets every GitHub ID too, on the register; and
/// forgets the resets that lapsed (ADR 0017).
Future<void> pruneAnonymousPeople(Session session) async {
final now = clock.now();

View file

@ -292,8 +292,9 @@ class FilePruningPruneFilesFutureCall extends _is.FutureCall
}
}
/// Prunes one batch and logs how many people went; once GitHub sign-in
/// has ended (`GITHUB_SIGN_IN_ENDS`), forgets every GitHub ID too; and
/// Prunes one batch and logs how many people went; 30 days after GitHub
/// sign-in ended (`GITHUB_SIGN_IN_ENDS`), deletes the accounts that had
/// no other way in and forgets every GitHub ID too, on the register; and
/// forgets the resets that lapsed (ADR 0017).
class PruningPruneAnonymousPeopleFutureCall extends _is.FutureCall
implements _is.InvokableFutureCall {