feat(data): SyncProvider::delete_account + SolitaireServerClient impl

Adds delete_account() as a default no-op on the SyncProvider trait.
SolitaireServerClient sends DELETE /api/account with JWT (retry on 401).
The server handler already existed (DELETE /api/account, ON DELETE CASCADE).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-04-27 02:10:26 +00:00
parent c6a596299e
commit 314186d6f4
2 changed files with 42 additions and 0 deletions
+8
View File
@@ -51,6 +51,11 @@ pub trait SyncProvider: Send + Sync {
async fn opt_out_leaderboard(&self) -> Result<(), SyncError> {
Ok(())
}
/// Permanently delete the authenticated player's account and all server
/// data. No-op for backends that don't support account management.
async fn delete_account(&self) -> Result<(), SyncError> {
Ok(())
}
}
/// Blanket impl so `Box<dyn SyncProvider + Send + Sync>` (returned by
@@ -84,6 +89,9 @@ impl SyncProvider for Box<dyn SyncProvider + Send + Sync> {
async fn opt_out_leaderboard(&self) -> Result<(), SyncError> {
(**self).opt_out_leaderboard().await
}
async fn delete_account(&self) -> Result<(), SyncError> {
(**self).delete_account().await
}
}
pub mod stats;