Skip to content

[BUG] Pull-to-refresh spinner hangs indefinitely on Music screen #335

@Amruth-hiremath

Description

@Amruth-hiremath

Describe the Bug

When pulling down to refresh the Music tab, the loading spinner gets stuck on the screen and spins indefinitely. The content refreshes in the background, but the UI indicator does not dismiss until the user manually scrolls the page up.

Steps to Reproduce

  1. Open the app and navigate to the Music tab.
  2. Pull down from the top to trigger a refresh.
  3. Observe the loading spinner staying on the screen forever.
  4. Scroll the page up slightly, and the spinner instantly disappears.

Expected Behavior

The PullToRefreshBox should automatically dismiss the spinner the moment the background data refresh completes, without requiring the user to scroll.

Root Cause:

In MusicViewModel.kt, the refresh() function triggers loadMusicContent(). Because the local cache check (MusicCache.getTrendingMusic) resolves almost instantly, isLoading is set to false immediately. The Compose ullToRefreshBox misses the brief state change and hangs waiting for a clear true -> false transition. The ViewModel needs to explicitly emit isLoading = true before kicking off the cache checks.

Actual Behavior

The pull-to-refresh spinner hangs indefinitely on the screen. It only disappears if the user manually scrolls the page up.

Screenshots or Screen Recordings

refresh_issue.mp4

Environment

Field Value
Device moto g85 5G
Android Version Android 15 (API 35)
Flow Version 2.0.5
Installation Sour GitHub APK
ROM Stock

Frequency

  • Every time (100% reproducible)
  • Often (happens most of the time)
  • Sometimes (happens intermittently)
  • Rarely (happened once or twice)

Affected Area

  • Video playback
  • Music player
  • Home feed / Recommendations
  • Search
  • Downloads
  • Subscriptions
  • Playlists
  • Picture-in-Picture / Background playback
  • Notifications
  • Settings / Preferences
  • Import / Export
  • Casting
  • SponsorBlock / DeArrow
  • Lyrics / Subtitles
  • UI / Theming
  • Performance / Battery
  • Other (describe below)

Logs (Optional but Helpful)

Click to expand logs N/A

Additional Context

This happens regardless of network speed (Wi-Fi or mobile data). The data itself refreshes properly in the background, but the UI state does not correctly reflect that the loading has finished.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcompletedFeature is fully implemented

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions