Skip to content

Fixed UI freeze occurring when the queue finishes playback.#176

Merged
basharovV merged 2 commits intobasharovV:mainfrom
Kwensiu:fix-ui-freeze
Dec 13, 2025
Merged

Fixed UI freeze occurring when the queue finishes playback.#176
basharovV merged 2 commits intobasharovV:mainfrom
Kwensiu:fix-ui-freeze

Conversation

@Kwensiu
Copy link
Contributor

@Kwensiu Kwensiu commented Dec 12, 2025

As described, it is unclear whether this issue occurs on your device. On my device, it can be reproduced 100% of the time with the following steps:

  1. Find a single-song album and start playing the album.
  2. Set the playback mode to sequential playback (i.e., pause after the playlist ends), and wait for the song to finish playing.
  3. UI freeze occurs, manifesting as an inability to switch pages/interfaces, although some animations may still be present. In some cases, the application may crash.

There are also related many warnings in DevTools, for example:

Waveform.svelte:219 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'fileInfo') at Waveform.svelte:219:57 at <anonymous>:272:26 at Object.runCallback (<anonymous>:284:7) at value (<anonymous>:366:40) at <anonymous>:1:88 at <anonymous>:1:29821 (anonymous) @ Waveform.svelte:219 (anonymous) @ VM2566:272 runCallback @ VM2566:284 value @ VM2566:366 (anonymous) @ VM3059:1 (anonymous) @ VM3059:1

Solution: After consulting with AI, I was advised to add optional chaining ( ?. ) and fallback default values ( || 0 or || 1 ) for $current.song.fileInfo Following these modifications, UI freezing no longer occurs in my tests. It is unclear if there are additional locations that could cause the same issue.

Kwensiu and others added 2 commits December 13, 2025 00:01
…ttributes

In the Waveform component, optional chaining and default values have been added to multiple accesses of $current.songand its fileInfoproperties to prevent runtime errors when song information hasn't loaded yet or is missing. Additionally, the no-longer-used responsiveproperty has been removed, and the zoom method's invocation parameters have been corrected to comply with the latest API requirements.
Ignoring waveform functions (click, peaks listener) when current song is null, and explicitly clearing waveform when reaching end of queue
@basharovV
Copy link
Owner

Nice thanks! I added a more explicit clearWaveform function when reaching the end of the queue (current.song is null). And instead of adding lots of optionals, it's probably cleaner to just return early from the function when we know that the song is null.

@Kwensiu
Copy link
Contributor Author

Kwensiu commented Dec 13, 2025

Nice thanks! I added a more explicit clearWaveform function when reaching the end of the queue (current.song is null). And instead of adding lots of optionals, it's probably cleaner to just return early from the function when we know that the song is null.

Nice, This works on my device as well.

@basharovV basharovV merged commit c7f00ec into basharovV:main Dec 13, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments