fix(auth): GitHub's end deletes what it says, when it says

An account deleted at GitHub's end whose host step after the deletion's
transaction failed counts as deleted, its GitHub ID gone with it, not as
one to try again (the short reading). The app's text for an account that
signs in with GitHub alone named the end as the day it would be deleted;
it is deleted 30 days later (gitHubAccountsKeptAfterEnd), which the text
now says, in English and German.

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 17:52:31 +02:00
commit a9bbda7017
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -328,6 +328,29 @@ void main() {
expect(notifier.told.toSet(), {dana, emil});
});
test('an account deleted whose step afterwards failed counts as '
'deleted, not as one to try again (the short reading)', () async {
useBase(
sessionBuilder,
deletePersonData: [
(session, person, transaction) => Future.value(
() => Future<void>.error(StateError('cleaning up failed')),
),
],
);
final ends = DateTime.utc(2027, 1, 22);
useGitHubSignInEnds(session.serverpod, ends);
final forgotten = await forgetGitHubAccounts(
session,
now: ends.add(gitHubAccountsKeptAfterEnd),
);
expect(await AuthUser.db.findById(session, ben), isNull);
expect(await GitHubAccount.db.count(session), 0);
expect(forgotten, 1);
});
test('at its end keeps the account of someone with an address too, '
'forgetting only the GitHub ID', () async {
final carl = (await AuthServices.instance.authUsers.create(