hrkfdn / ncspot

Cross-platform ncurses Spotify client written in Rust, inspired by ncmpc and the likes.
BSD 2-Clause "Simplified" License
5.09k stars 212 forks source link

Crashes when attempting to load a large playlist #1506

Open tomasguinzburg opened 3 months ago

tomasguinzburg commented 3 months ago

Describe the bug When attempting to reproduce a playlist from the search with ~1000 tracks, the program freezes.

To Reproduce Steps to reproduce the behavior:

  1. Press F2 to search.
  2. Write "Disclosure's Record Bag" on the search, hit intro.
  3. Navigate to playlists (triple right arrow on my mappings)
  4. Hit intro on top of the playlist "Disclosure's Record Bag - Disclosure" as shown in the screenshot
  5. Program should stop audio and freeze, can't be killed without killing terminal.

Expected behavior Playlist is added to queue and starts reproducing

Screenshots image

System (please complete the following information):

Backtrace/Debug log No crash, just frozen

Additional context Low CPU load even when frozen, computer should be able to handle it pretty well. Playlist has an emoji in the name, and there are some song titles with weird characters (One by Four Tet has very weird characters). I'm not too sure what other tests I can run, happy to help.

I tried the 4th playlist for me, by Deli Paloma-Sisk with 1027 songs, and that one works although it sometimes doesn't, displaying 0 songs but without freezing.

tomasguinzburg commented 3 months ago

ncdebug.log

I see this error repeatedly:

[2024-08-19][17:11:08] [ncspot::spotify_api] [ERROR] unhandled api error: json parse error: data did not match any variant of untagged enum PlayableItem at line 1 column 26378

And also a lot of HTTP 429, possible because of the size of the playlist the pagination is hitting rate limits. However, the pagination doesn't seem to advance either, it's always requesting with offset=100 and limit=100.