Class TeamPurgeCascade
Destroys a team's data in the toolkit's own stores, before the team itself is purged.
public sealed class TeamPurgeCascade
- Inheritance
-
TeamPurgeCascade
- Inherited Members
Remarks
Purge does not reach these stores on its own. It deletes the team record and drops the host's per-team database — but API keys, icons and support cases live in the toolkit's own shared collections keyed by team, so nothing there is touched. For API keys that is a security problem rather than untidiness: a credential outliving the tenant it authorized, and inherited by whoever next takes that team key.
A collaborator, not a decorator. It is invoked from the one place that already intercepts purge —
the authorization decorator — rather than wrapping Tharga.Team.ITeamService again, which would mean
thirty pass-through members for one intercepted call. It authorizes nothing; by the time it runs,
teams:purge has been checked.
Soft delete deliberately does not cascade. A soft-deleted team can be restored, and a restore that brought back a team with no API keys, no icons and no history would be a restore in name only. Purge is the irreversible operation, so purge is where data is destroyed.
Constructors
TeamPurgeCascade(IEnumerable<ITeamPurgeParticipant>, ILogger<TeamPurgeCascade>)
Destroys a team's data in the toolkit's own stores, before the team itself is purged.
public TeamPurgeCascade(IEnumerable<ITeamPurgeParticipant> participants, ILogger<TeamPurgeCascade> logger = null)
Parameters
participantsIEnumerable<ITeamPurgeParticipant>loggerILogger<TeamPurgeCascade>
Remarks
Purge does not reach these stores on its own. It deletes the team record and drops the host's per-team database — but API keys, icons and support cases live in the toolkit's own shared collections keyed by team, so nothing there is touched. For API keys that is a security problem rather than untidiness: a credential outliving the tenant it authorized, and inherited by whoever next takes that team key.
A collaborator, not a decorator. It is invoked from the one place that already intercepts purge —
the authorization decorator — rather than wrapping Tharga.Team.ITeamService again, which would mean
thirty pass-through members for one intercepted call. It authorizes nothing; by the time it runs,
teams:purge has been checked.
Soft delete deliberately does not cascade. A soft-deleted team can be restored, and a restore that brought back a team with no API keys, no icons and no history would be a restore in name only. Purge is the irreversible operation, so purge is where data is destroyed.
Methods
RunAsync(string, CancellationToken)
Runs every participant. Throws if one fails, leaving the team present so the purge can be retried.
public Task RunAsync(string teamKey, CancellationToken cancellationToken = default)
Parameters
teamKeystringcancellationTokenCancellationToken
Returns
Remarks
The failure direction is chosen, not accidental. The participant writes and the team-record delete cannot be made atomic. Aborting first leaves a team whose data is partly gone — visible, and re-purgeable, because participants are required to be safe to run again. Deleting the team first and then failing would leave data nothing can find, which is the outcome this whole seam exists to prevent.