3. the check here returns false because the listen was updated already when the modification in 2 happened.
so we get an outdated/incorrect cover art thumbnail.
does this make sense?
monkey
OK, I'm following so far, looks like the classic react class props updating issues
(my bad)
lucifer
right that props issues plus not cloning the object before storing it in state
monkey
OK, that seems easy to fix
lucifer
the point fix is indeed easy.
we could deepcopy the playing now listen before passing it in the prop.
and update the check in componentDidUpdate to compare the existing state to the new prop
and merge the data together in case of a mismatch.
or we could start including the caa_id and caa_release_mbid in the react key for the listen cards.
the fix involving key is probably the recommended one.
monkey
Yep, I was wondering what we could use in the key to make it more robust
It's indeed the absolute simlest.
+p
lucifer
however, i was wondering as we move LB towards a SPA. there will be more and more such cases of fields that need updating.
monkey
However it does require the same mechanism be applied everywhre ListenCards are in use, which will result in some issue eventually
lucifer
how many fields do we manually list out in the key? should we instead look into hashing the entire object and using the hashcode as a key
monkey
Hm, not a bad idea at all
Our objects are not gigantic so the computational tradeoff is probably OK.
lucifer
i couldn't find anything online about using hashcodes as keys which is weird.
i assumed others would have faced similar issues
right the computational tradeoff is something i am not sure about. i was also going to suggest to always deepcopy the listen inside the constructor of the ListenCard to avoid the other issue in this bug but again that comes at a computational tradeoff.
monkey
Keys are usually easier to generate, and I think the main issue is in componendDidUpdate which is being retired, so probably not a huge use case
The deep cloning shouldn't be an issue actually.
At least for our sizes of objects and number of listencards
lucifer
i see makes sense.
i can see the same issues arising out of multiple useEffects interactions in ListenCard when we do the rewrite of the component but we can take a look into it when it actually happens i guess.
that should improve the playlists, but may end up not generating as many tracks.
lucifer: thanks!
mayhem is starting on the mosaic
monkey
I think it would be a good idea to generate this year's stats (complete with new datapoints) for a few users for some proper testing, including all the "you don't have enough data" stuff
lucifer
sure will do
do we want to add any new stats/datapoints?
monkey
We also have the SVG images currently pending. I started setting them up
lucifer
i can do the SVGs if you want.
monkey
Re: new data points: if you compare with the figma design, there are some items currently missing, in particular genre-related data
We already have some of that data, and I guess you'll be working on the tags stats which can then fit in there
lucifer
makes sense.
i'll get the stats done
monkey
I started some small refactoring for the YIM art endpoints, by the way, to allow for this new year while reusing some of the existing code
It's all on branch `yim-2023`
Ah, and I believe you took care of the email design as well last year; do you want to do that this year too, or would you like some help with it?
yvanzo
lucifer: done, added a comment to the pull request.
monkey
On my side, I'm going to continue implementing the stats art SVGs and prepare the "coming soon" page, the "not enough data" page and other small items well need to have ready
lucifer
monkey: should be able to do the emails but would need help with testing on apple devices.
And maybe in a week or so we have another chat, see where we're at and add in the new datapoints in the page, maybe deploy to test and have a look at what we're forgetting ? :D
lucifer
sounds great.
monkey
👍 sweet, we're on track :)
lucifer
thanks!
monkey
Thank you !
lucifer
mayhem: how did you handle the case of multiple artists on one track in troi? do you count it as one recording for each?
mayhem
lemme see
yes.
I unroll the artist credit and then count each of the artists as one.
that is perhaps a bit to tight, but lets just keep that for now.