MusicKit JS finding 81 playlists I don't have

Hey All,

I am in the middle of developing a little web app using MusicKit JS, and I deleted all my playlists so I could do a little testing.

But when I get all library playlists, the query returns 81 phantom playlists. The playlists don't have names in the JSON, so I can't work out their source. It doesn't show any of the playlists I have added and just keeps returning 81 phantom library playlists.

When I tested my code using another person's Apple ID, it works perfectly, retuning all the playlists in their library.

Is there a way to reset the library or fix this?

I am using V1 of the MusicKit library.

Thanking everyone in advance. Jacko

Thank you for the question, @Jacko441

There are a few potential things going on here, depending on exactly which APIs are being called.

For performance reasons, there is often a slight delay in updating or deleting playlists. This would be the situation if you delete a specific playlist by ID and then attempt a GET for the same record within a minute or so and it still is available. The "get all playlists" APIs may take a bit longer as well.

There is also a feature for supporting pagination where 'phantom' playlist records may still be returned in the response so that the offsets do not change when making paginated requests. For example, if you had 10 playlists and were requesting them in batches of 5 at a time (limit query param equal to 5), but a delete happened for an item on the first page between fetching the first page and second page, the resulting list could be missing a playlist that should have been on page 2. The 'phantom' results would prevent such an issue.

Filing a ticket in the Feedback Assistant with a .har export from the network inspector showing the issue would help diagnose further.

MusicKit JS finding 81 playlists I don't have
 
 
Q