fix(flutter): analyze errors after Plan B push
Cleared 5 errors + 1 warning + 1 info from CI flutter analyze on 5114a81:
- prefetcher.dart: Riverpod listener callbacks used (_, _) for two
placeholder params — Dart 3 enforces unique names. Changed to (_, __).
- prefetcher.dart: Riverpod 3's AsyncValue exposes `.value` (nullable)
not `.valueOrNull`. Three call sites updated.
- sync_controller.dart: doc comment had `?since=<cursor>` → analyzer
warned about unintended HTML. Wrapped in backticks with `{cursor}`.
- sync_controller.dart: delete loop over heterogeneous Table list
inferred as List<Table>; drift's delete() expects TableInfo. Unrolled
to explicit per-table deletes.
- audio_cache_manager_test.dart: db.into(...).insertAll([...]) doesn't
exist on InsertStatement — only insert/insertOnConflictUpdate. Used
db.batch((b) => b.insertAll(table, [...])) instead, in two test cases.
- audio_handler.dart: LockCachingAudioSource is marked experimental in
just_audio. Added // ignore: experimental_member_use — operator
acknowledged the experimental status during brainstorming and we're
the project; CI's --fatal-infos would otherwise gate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+7
-11
@@ -19,7 +19,7 @@ class SyncResult {
|
||||
}
|
||||
|
||||
/// Drives the delta-sync against the server (#357 Plan A endpoint).
|
||||
/// Reads cursor from drift, calls /api/library/sync?since=<cursor>,
|
||||
/// Reads cursor from drift, calls `/api/library/sync?since={cursor}`,
|
||||
/// applies upserts + deletes, advances cursor.
|
||||
class SyncController extends AsyncNotifier<SyncResult?> {
|
||||
@override
|
||||
@@ -55,16 +55,12 @@ class SyncController extends AsyncNotifier<SyncResult?> {
|
||||
// local state and retry once with cursor=0.
|
||||
if (resp.statusCode == 410) {
|
||||
await db.transaction(() async {
|
||||
for (final t in [
|
||||
db.cachedArtists,
|
||||
db.cachedAlbums,
|
||||
db.cachedTracks,
|
||||
db.cachedLikes,
|
||||
db.cachedPlaylists,
|
||||
db.cachedPlaylistTracks,
|
||||
]) {
|
||||
await db.delete(t).go();
|
||||
}
|
||||
await db.delete(db.cachedArtists).go();
|
||||
await db.delete(db.cachedAlbums).go();
|
||||
await db.delete(db.cachedTracks).go();
|
||||
await db.delete(db.cachedLikes).go();
|
||||
await db.delete(db.cachedPlaylists).go();
|
||||
await db.delete(db.cachedPlaylistTracks).go();
|
||||
await db.into(db.syncMetadata).insertOnConflictUpdate(
|
||||
SyncMetadataCompanion.insert(cursor: const drift.Value(0)),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user