A decentralized music tracking and discovery platform built on AT Protocol 🎵
listenbrainz spotify atproto lastfm musicbrainz scrobbling

Spread nowPlayings into payload and cache

Make the client update now-playings by assigning a fresh array and
disable redundant invalidations. Adjust the websocket message shape so
the fields arrive at the top level for the client to consume.

Changed files
+6 -4
apps
web
src
pages
home
feed
ws
src
+5 -3
apps/web/src/pages/home/feed/Feed.tsx
··· 74 74 } 75 75 76 76 const message = JSON.parse(event.data); 77 - queryClient.setQueryData(["now-playings"], () => message.nowPlayings); 77 + queryClient.setQueryData(["now-playings"], () => [ 78 + ...message.nowPlayings, 79 + ]); 78 80 queryClient.setQueryData( 79 81 ["scrobblesChart"], 80 82 () => message.scrobblesChart, ··· 83 85 await queryClient.invalidateQueries({ 84 86 queryKey: ["infiniteFeed", feedUri], 85 87 }); 86 - await queryClient.invalidateQueries({ queryKey: ["now-playings"] }); 87 - await queryClient.invalidateQueries({ queryKey: ["scrobblesChart"] }); 88 + // await queryClient.invalidateQueries({ queryKey: ["now-playings"] }); 89 + // await queryClient.invalidateQueries({ queryKey: ["scrobblesChart"] }); 88 90 }; 89 91 90 92 return () => {
+1 -1
apps/ws/src/main.ts
··· 80 80 if (channels.has(collection) && socket.readyState === WebSocket.OPEN) { 81 81 socket.send( 82 82 JSON.stringify({ 83 - nowPlayings, 83 + ...nowPlayings, 84 84 scrobbles, 85 85 scrobblesChart, 86 86 actorScrobbles,