Skip to content

Add support for deleting legacy replays and scores#363

Open
peppy wants to merge 1 commit intoppy:masterfrom
peppy:legacy-score-deletion
Open

Add support for deleting legacy replays and scores#363
peppy wants to merge 1 commit intoppy:masterfrom
peppy:legacy-score-deletion

Conversation

@peppy
Copy link
Member

@peppy peppy commented Mar 5, 2026

Needs testing.

DogStatsd.Increment("legacy_scores_deleted");
var rulesetSpecifics = LegacyDatabaseHelper.GetRulesetSpecifics(score.ruleset_id);

await s3.DeleteObjectAsync(rulesetSpecifics.ReplayBucket, score.legacy_score_id.ToString(), cancellationToken);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not checking the result state of this intentional?

AWSSDK has a strange (for .NET land) API design where it will return failures wrapped in objects rather than do anything like throwing.

Comment on lines +148 to +151
await s3.DeleteObjectAsync(rulesetSpecifics.ReplayBucket, score.legacy_score_id.ToString(), cancellationToken);

await db.ExecuteAsync($"DELETE FROM {rulesetSpecifics.ReplayTable} WHERE score_id = @scoreId", new { scoreId = score.legacy_score_id });
await db.ExecuteAsync($"DELETE FROM {rulesetSpecifics.HighScoreTable} WHERE score_id = @scoreId", new { scoreId = score.legacy_score_id });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this should all probably be guarded with !DryRun.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants