gokadzev/Musify

[Bug] User Playlist Show "Something went wrong"

Closed this issue · 1 comments

Acknowledgements

  • I have searched the existing issues and confirmed that this is a new issue, not a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I have updated the app to the latest version. You can find the latest version here.
  • I will fill out all the sections in this issue report.

Current Behavior

every time I access User Playlists menu.
it shows "Something went wrong" and nothing else

Expected Behavior

Valid playlists should be shown

Steps To Reproduce

  1. try add a user playlist with invalid youtube id "PLzdLDJsHzz2NiuwjyW6QgSck4PrlSyOc"
  2. Try to access User Playlists menu

Musify Version

7.5.0

Device And Operating System

Samsung SM-A826S

Android Version You Use

Android 14

Additional Information

I tried to reproduce it with debug build. And I got error logs.

I/flutter (20136): [2024-02-11 22:52:12.459123] Error on user playlists page:FatalFailureException: Failed to perform an HTTP request to YouTube due to a fatal failure.
I/flutter (20136): In most cases, this error indicates that YouTube most likely changed something, which broke the library.
I/flutter (20136): If this issue persists, please report it on the project's GitHub page.
I/flutter (20136): Request: GET https://www.youtube.com/playlist?list=PLzdLDJsHzz2NiuwjyW6QgSck4PrISyOc&hl=en&persist_hl=1
I/flutter (20136): Response: (404)
I/flutter (20136): 
I/flutter (20136): #0      YoutubeHttpClient._validateResponse (package:youtube_explode_dart/src/reverse_engineering/youtube_http_client.dart:59:7)
I/flutter (20136): #1      YoutubeHttpClient.getString (package:youtube_explode_dart/src/reverse_engineering/youtube_http_client.dart:74:7)
I/flutter (20136): <asynchronous suspension>
I/flutter (20136): #2      PlaylistPage.get.<anonymous closure> (package:youtube_explode_dart/src/reverse_engineering/pages/playlist_page.dart:63:19)
I/flutter (20136): <asynchronous suspension>
I/flutter (20136): #3      retry (package:youtube_explode_dart/src/retry.dart:16:14)
I/flutter (20136): <asynchronous suspension>
I/flutter (20136): #4      PlaylistClient.get (package:youtube_explode_dart/src/playlists/playlist_client.dart:23:9)
I/flutter (20136): <asynchronous suspension>
I/flutter (20136): #5      getUserPlaylists (package:musify/API/musify.dart:100:19)
I/flutter (20136): <asynchronous suspension>
I/flutter (20136): #6      _FutureBuilderState._subscribe.<anonymous closure> (package:flutter/src/widgets/async.dart:624:31)
I/flutter (20136): <asynchronous suspension>
I/flutter (20136): 

Thank you for opening a good issue! I've already pushed the fix commit. So, if there are any invalid playlists added instead of always throwing an error, the next time you open the user playlists page and it starts fetching, it will automatically remove the invalid playlists, thus resolving the error.

Edit: I added an additional check during the addition process. There will be a 1-second delay for the check while adding, but I believe it's worth it.