#metabrainz

/

      • reosarevok
        bitmap: I don't think so. ruaok, can you give it one final look?
      • CatQuest
        shivam-kapila: i see no follow button :(
      • ruaok
        k
      • CatQuest
        if you lcick it, what is the url it goes to
      • also what is the urlfo the image
      • ruaok
        > We are also upping the required versions of both Perl and Node.js.
      • shivam-kapila
        > if you lcick it, what is the url it goes to
      • its a POST request, and I think it can be executed in the browser only via some code
      • ruaok
        might be nice to actually mention which versions right in the sentence.
      • shivam-kapila
        > also what is the urlfo the image
      • sorry which image CatQuest?
      • iliekcomputers
      • This is what should be happening
      • CatQuest
        sorri assumed that the "follow me" button was an image
      • bitmap
        ruaok: +1
      • ruaok
        bitmap: reosarevok: looks good. it could use some boilerplate guff at the bottom: "We'll post final details about this release just prior to the release and shortly after we complete the release, we'll post instructions on how you can update your own copy.".
      • that's a beefy list -- good luck!
      • !m MB team
      • BrainzBot
        You're doing good work, MB team!
      • bitmap
        thanks!
      • shivam-kapila
        CatQuest: anything visible in browser logs?
      • bitmap
        reosarevok: made the changes ruaok mentioned
      • if they look ok feel free to hit publish
      • shivam-kapila
        Mr_Monkey: there's a test missing for updateMode in FollowerFollwing Modal and a render test for SimilarUsers modal. Shall I add these?
      • alastairp
        I get 4pm sun directly in my eyes when sitting at my desk only during summer
      • I think I'm going to need a summer house and a winter house
      • shivam-kapila
        rich alastairp
      • Mr_Monkey
        Yes please shivam-kapila !
      • HenryG has quit
      • akashgp09 joined the channel
      • HenryG joined the channel
      • reosarevok
        bitmap: oh, yvanzo wanted zas to confirm that moving to 20.04 would be sensible
      • (for Perl 5.30)
      • zas
        reosarevok: it shouldn't be much an issue, as https://github.com/phusion/baseimage-docker is now based on 20.04
      • at worse, if something breaks, we'll have to fix it anyway
      • RikkoM has quit
      • bitmap
        ok, I'll make a new branch for https://github.com/metabrainz/base-image
      • akashgp09 has quit
      • akashgp09 joined the channel
      • Mr_Monkey
        I deployed the similar users PR on https://test.listenbrainz.org/feed , it's looking nice !
      • shivam-kapila
        Mr_Monkey: added the tests
      • there seem to be many tests build in the queue. can we stop some unneccessary ones?
      • _lucifer
        alastairp, i have updated https://github.com/metabrainz/listenbrainz-serv... with the spotify reader fix.
      • alastairp
        I'm just looking at it now
      • _lucifer: I was just reading code. spotify_read_listens line 149:
      • time_to_sleep = e.headers.get('Retry-After', delay)
      • is that header value going to be a string or an int?
      • _lucifer
      • msaaddev joined the channel
      • msaaddev
        Hey, yvanzo and reosarevok I hope you folks are doing alright. My name is Saad. I am a Computer Science Junior at college. I am really interested in one of your GSoC 2021 projects of Pushing the URL relationship editor to the next level. I am an experienced JavaScript developer, specifically in React.js. I was looking for the repo to get better
      • understanding of the codebase but unfortunately, I couldn't find it. Can you please share the link so that I can get started? Thank you!
      • _lucifer
      • and welcome to the community!
      • Mr_Monkey
        Welcome msaaddev !
      • shivam-kapila
        Mr_Monkey: Is 1320 ready from your side?
      • Mr_Monkey
        I was reviewing once more
      • But yeah, it all seems to be there and working, and the code looks clean (to me). I haven't looked at the python parts much.
      • shivam-kapila
        I am also reviewing and the python bits looks sane
      • Mr_Monkey
        With that PR we're adding endpoints to the API. Is there anything we need to do regarding that? Are the docs all there?
      • shivam-kapila
        The api endpoints lack docstrings
      • Mr_Monkey
        Could you tackle that too please?
      • shivam-kapila
        ok will do
      • alastairp
        _lucifer: that still looks suspicious to me. https://github.com/plamere/spotipy/blob/master/... shows that it directly returns the `requests` Response.headers dict. I don't think that requests does anything magic with numbers
      • in fact, I just did a quick test and got this response:
      • {'Date': 'Wed, 17 Mar 2021 16:18:22 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '16', 'Connection': 'keep-alive', 'X-Powered-By': 'Express', 'Access-Control-Allow-Origin': '*', 'x-pd-status': 'sent to primary'}
      • content-length is a string, even though the underlying data is an int
      • but you're right, I see no TypeErrors in sentry that might be caused by this
      • makes me think that we're never getting that field :/
      • _lucifer
        alastairp, that sounds right. i went through the sentry stacktrace i posted, there is no 429 there only 500s
      • akashgp09 has quit
      • alastairp
        I'll open a ticket fo rit
      • _lucifer
      • the 429 is from spotipy not actually spotify
      • alastairp
        so this exception doesn't set headers
      • but the one that I linked does
      • _lucifer
        yes right and further its not a rate limit actually but too many 500s
      • alastairp
        but I think that spotify does return 429 as well, this is just a special-case that the bindings do after it's run out of retries
      • _lucifer
        yes, its not well documented but there are some posts on spotify community about rate limiting
      • akashgp09 joined the channel
      • alastairp
        LB-842
      • BrainzBot
        LB-842: Parse Retry-After header as int before using in sleep https://tickets.metabrainz.org/browse/LB-842
      • _lucifer
        should i just include the fix in the current PR?
      • reosarevok
        bitmap: looks good, published
      • alastairp
        _lucifer: yeah, we're working on it anyway so may as well
      • _lucifer
        👍
      • alastairp
        Mr_Monkey: hai!
      • Mr_Monkey
        Hai !
      • alastairp
        why did this need to move out of the if?
      • RikkoM joined the channel
      • Mr_Monkey
        If the owner is the only item in the collaborators list, it will be removed by that bit of code, and as a consequence we pass an empty list to `get_many_users_by_mb_id`, and it doesn't like that (SQL exception about `IN ()`)
      • alastairp
        ahhh, that's https://sentry.metabrainz.org/metabrainz/listen... which I had open to look at!
      • great fix 🎉
      • Mr_Monkey
        correct
      • and thanks :)
      • alastairp
        and I see that you did mention this in the PR body too
      • Mr_Monkey
        I haven't used sentry much; am I supposed to resolve those if they are fixed?
      • alastairp
        yes, that'd be good
      • because then it'll alert us again if it happens again
      • Mr_Monkey
        Yeah, it's obvious now that I phrase it :p
      • alastairp
        I don't use sentry very well either
      • RikkoM has quit
      • msaaddev has quit
      • _lucifer
        assuming spotify follows the Oauth spec for invalid grant, `invalid_grant` can also occur if our credentials or redirect uri is incorrect.
      • >The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.
      • alastairp, should we add a check for this?
      • alastairp
        in which place? while a user is doing the auth workflow?
      • _lucifer
        in `refresh_user_token`
      • in case `refresh_user_token` gets an `invalid_grant` it will unlink the user.
      • alastairp
        "does not match redirect uri" seems a bit weird
      • does that mean that if we changed the redirect url in our app, and then tried to refresh everyone, it'd fail?
      • _lucifer
        that's from the OAuth Spec
      • alastairp
        I just had a thought here too - we delete the row if the refresh fails
      • but doesn't the row include the error message?
      • _lucifer
        yes, i think so and unlink all the users along the way
      • SothoTalKer has quit
      • i din't understand which row? the row for that user in spotify auth table?
      • SothoTalKer joined the channel
      • alastairp
        sorry, yeah. spotify_auth
      • spotify_auth.error_message
      • _lucifer
        yeah, right. that would be an issue.
      • dpmittal_ joined the channel
      • how about instead of deleting we update the error message or add a column to the table and check for a specific message or that field before processing a user?
      • alastairp
        yeah, I'd be happy to have an active field
      • BrainzGit
        [troi-recommendation-playground] mayhem merged pull request #34 (main…improved-mbid-mapping): Improved mbid mapping, playlist submit improvements and year lookup improvements. https://github.com/metabrainz/troi-recommendati...
      • _lucifer
        makes sense.
      • alastairp
        but if this PR allows us to update the spotify reader container then let's merge it and open a ticket for this and add it next
      • _lucifer
        it will begin to error when we try to update the error message i think because the user is not present in the db
      • akashgp09 has quit
      • alastairp
        ah, right
      • yeah, let's use exceptions to indicate that case then, and do all database work in process_one_user
      • _lucifer
        ah actually it won't since we already a different exception
      • but yeah moving the logic to process_one_user is probably better to keep it one place and avoid confusion
      • RikkoM joined the channel
      • -- BotBot disconnected, possible missing messages --
      • BrainzBot joined the channel
      • this one points to my branch
      • alastairp
        ah, now your question makes more senses
      • sense
      • so you're asking "should we catch expction; log; raise in process_one_user" or "just call refresh_user_token and catch/log in process_all_users"
      • bitmap
        reosarevok: yvanzo: I'm wondering how we should deal with keeping these new materialized tables up-to-date on slave servers. they aren't replicated and slaves don't have triggers, we we'd either have to add a file for slave-only triggers, or regenerate the tables hourly after packets are applied
      • _lucifer
        alastairp, yes
      • alastairp
        the only thing I'd consider here is where we want to modify the database row. it doesn't make sense to modify a single user in process_all_users when there's an auth issue, and in process_one_user in all other cases
      • keeping it together in a single method would be easier I think
      • goapunk_ is now known as goapunk
      • having said that - I'm thinking through a use-case here: token hasn't expired, but when we try and get currently playing we get an exception because the user has revoked permission
      • in that case it sounds like we should wrap all of process_one_user in a try/except?
      • _lucifer
        yeah, it kinda already is in process_all_users and that's the only place we call it
      • alastairp
        oh, you're right. line 330-339?