Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: prevent UI freeze when searching for recommendations
Instead of taking app lock before API fetch, taking it after fixes the issue
  • Loading branch information
rlpratyoosh committed May 9, 2026
commit 082f4b22fde3671863951749c1ea0233ccfb506c
2 changes: 1 addition & 1 deletion src/infra/network/recommend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ impl RecommendationNetwork for Network {
.await
{
Ok(recommendations) => {
let mut app = self.app.lock().await;
// Convert SimplifiedTrack to FullTrack (best effort)
// SimplifiedTrack doesn't have album field which FullTrack needs.
// This is tricky. Recommendations usually return SimplifiedTracks.
Expand All @@ -72,6 +71,7 @@ impl RecommendationNetwork for Network {
}
}

let mut app = self.app.lock().await;
app.track_table.tracks = full_tracks;

// Prepend the seed track if available so user knows context
Expand Down