v2.53 — Tombstone-Sync + Konflikt-Report (Sprint E): deleted_at, lokal nachgezogene Löschungen, Willkommen-zurück-Dialog

This commit is contained in:
Dustin
2026-08-05 11:14:21 +02:00
parent 22ce611537
commit 2d735464c0
3 changed files with 244 additions and 9 deletions
+9 -2
View File
@@ -149,12 +149,19 @@ class CloudService extends ChangeNotifier {
}
}
Future<bool> delete(String songId) async {
/// Song auf dem Server als gelöscht markieren (Tombstone).
/// [deletedAt] (ISO-Zeitstempel) dokumentiert den Löschzeitpunkt — Offline-
/// Geräte vergleichen ihn mit ihrem letzten Sync und löschen lokal nach
/// (keine Zombie-Songs). Ohne [deletedAt] stempelt der Server selbst.
Future<bool> delete(String songId, {String? deletedAt}) async {
try {
final r = await _client
.post(Uri.parse('$_base/api/v1/cloud/delete'),
headers: _jsonHeader,
body: jsonEncode({'song_id': songId}))
body: jsonEncode({
'song_id': songId,
if (deletedAt != null) 'deleted_at': deletedAt,
}))
.timeout(const Duration(seconds: 10));
return r.statusCode == 200;
} catch (_) {