chore(flutter): drop success-path diagnostic prints
Cleanup pass on the noisy debugPrints we added during the recent debugging sessions. Remaining prints are error-path only: - AlbumCoverCache fetch failed - album/playlist cold-cache fetch failed - audio_handler playbackEventStream error - audio_handler queue supersession (rare race) - audio_handler forward/backward fill failed - artist_detail play failed - cacheFirst fetchAndPopulate failed (only when tag is set) Removed per-event chatter: - audio_handler player-state and processingState subscribers - audio_handler timing measurements (built initial / setAudioSources / forward fill / backward fill) - audio_handler cache hit/miss per-track (fired N times per play) - audio_handler register stream cache (verifiable via Settings) - audio_handler.configure log - albumProvider step-by-step lines (drift miss / online / drift hit / album hit but no tracks) - playlistDetailProvider step-by-step lines (calling get / drift write done / 404 evicted / drift hit / playlist hit but no tracks) - playlistsListProvider wire returned + drift rows lines - playTracks stage timings (serverUrl / token / configure / setQueue / play returned) - metadataPrefetcher warming N artists - artist_detail play tapped — N tracks success log - cacheFirst step-by-step (drift hit / drift miss / online / done) `tag` parameter on cacheFirst preserved for ad-hoc instrumentation.
This commit is contained in:
@@ -40,11 +40,6 @@ final playlistsListProvider =
|
||||
fetchAndPopulate: () async {
|
||||
final api = await ref.read(playlistsApiProvider.future);
|
||||
final fresh = await api.list(kind: kind);
|
||||
final ownedSysCount =
|
||||
fresh.owned.where((p) => p.systemVariant != null).length;
|
||||
debugPrint(
|
||||
'playlistsListProvider($kind): wire returned owned=${fresh.owned.length} '
|
||||
'(system=$ownedSysCount) public=${fresh.public.length}');
|
||||
|
||||
// Reconcile: BuildSystemPlaylists rotates system-playlist UUIDs
|
||||
// every rebuild, so insertOrReplace alone leaves stale rows in
|
||||
@@ -81,13 +76,6 @@ final playlistsListProvider =
|
||||
.where((r) => r.userId != user.id && r.isPublic)
|
||||
.map((r) => r.toRef())
|
||||
.toList();
|
||||
final ownedSys = owned.where((p) => p.isSystem).length;
|
||||
final driftSys = filtered.where((r) => r.systemVariant != null).length;
|
||||
debugPrint(
|
||||
'playlistsListProvider($kind): drift rows=${rows.length} '
|
||||
'filtered=${filtered.length} (system=$driftSys) '
|
||||
'owned=${owned.length} (system=$ownedSys) pub=${pub.length} '
|
||||
'userId=${user.id}');
|
||||
return PlaylistsList(owned: owned, public: pub);
|
||||
},
|
||||
isOnline: () async => (await ref
|
||||
@@ -153,10 +141,7 @@ final playlistDetailProvider =
|
||||
Future<bool> fetchAndPopulate() async {
|
||||
try {
|
||||
final api = await ref.read(playlistsApiProvider.future);
|
||||
debugPrint('playlistDetailProvider($id): calling get');
|
||||
final fresh = await api.get(id).timeout(const Duration(seconds: 10));
|
||||
debugPrint(
|
||||
'playlistDetailProvider($id): got ${fresh.tracks.length} tracks, writing');
|
||||
|
||||
// Collect the track + artist + album rows referenced by these
|
||||
// playlist entries. Without writing the cachedTracks rows
|
||||
@@ -262,8 +247,6 @@ final playlistDetailProvider =
|
||||
);
|
||||
}
|
||||
});
|
||||
debugPrint(
|
||||
'playlistDetailProvider($id): drift write done; awaiting watch re-emit');
|
||||
return true;
|
||||
} catch (e, st) {
|
||||
// 404 = the playlist row in drift is stale (BuildSystemPlaylists
|
||||
@@ -272,8 +255,6 @@ final playlistDetailProvider =
|
||||
// stale row + its track positions so the home tile disappears
|
||||
// on next render and we don't keep trying.
|
||||
if (e is DioException && e.response?.statusCode == 404) {
|
||||
debugPrint(
|
||||
'playlistDetailProvider($id): server says 404, evicting stale drift rows');
|
||||
await db.batch((b) {
|
||||
b.deleteWhere(
|
||||
db.cachedPlaylistTracks, (t) => t.playlistId.equals(id));
|
||||
@@ -292,7 +273,6 @@ final playlistDetailProvider =
|
||||
|
||||
await for (final playlistRows in playlistQuery.watch()) {
|
||||
if (playlistRows.isEmpty) {
|
||||
debugPrint('playlistDetailProvider($id): drift miss, cold-fetching');
|
||||
if (fetchAttempted) {
|
||||
yield emptyDetail();
|
||||
continue;
|
||||
@@ -307,9 +287,6 @@ final playlistDetailProvider =
|
||||
continue;
|
||||
}
|
||||
|
||||
debugPrint(
|
||||
'playlistDetailProvider($id): drift hit (${playlistRows.length} rows)');
|
||||
|
||||
final playlist = playlistRows.first.toRef();
|
||||
final trackRows = await tracksQuery.get();
|
||||
|
||||
@@ -318,8 +295,6 @@ final playlistDetailProvider =
|
||||
// tracks for system playlists). Trigger the same fetch, drift
|
||||
// watch re-emits with populated tracks.
|
||||
if (trackRows.isEmpty && !fetchAttempted) {
|
||||
debugPrint(
|
||||
'playlistDetailProvider($id): playlist hit but no tracks; fetching');
|
||||
fetchAttempted = true;
|
||||
if (await isOnline()) {
|
||||
final ok = await fetchAndPopulate();
|
||||
|
||||
Reference in New Issue
Block a user