#metabrainz

/

      • zas
        yes, we only need to deploy changes and reboot
      • 2023-03-21 08054, 2023

      • akshaaatt
        Android apps can easily be decompiled. Any user could get our refresh token, which is a concerning thing
      • 2023-03-21 08056, 2023

      • jasje
        akshaaatt: no idea what refresh tokens do :(
      • 2023-03-21 08046, 2023

      • akshaaatt
        As the name suggests, refresh tokens allow us to refresh the access tokens for a user
      • 2023-03-21 08000, 2023

      • akshaaatt
        access tokens live for a short period of time
      • 2023-03-21 08030, 2023

      • akshaaatt
        Hence, we use refresh tokens to keep the user signed in to the app at regular intervals of time
      • 2023-03-21 08044, 2023

      • jasje
        when does mb token expire?
      • 2023-03-21 08050, 2023

      • akshaaatt
        For example, access tokens can live for 1hr but a refresh token can live for 30 days
      • 2023-03-21 08052, 2023

      • monkey
        lucifer, mayhem : Looks like our LB API docs cannot build since LB#2360 due to an incompatibility between the newer versions of werkzeug (> 2.1.2) and sphinxcontrib.autohttp
      • 2023-03-21 08052, 2023

      • monkey
        The issue is described in more details here: https://github.com/sphinx-contrib/httpdomain/issu…
      • 2023-03-21 08052, 2023

      • monkey
        In the issue, people are suggesting to copy the missing `werkzeug.routing.parse_rule` method as described here: https://github.com/python-restx/flask-restx/pull/…
      • 2023-03-21 08052, 2023

      • monkey
        I have no idea if that is a good way to resolve this sort of python dependency issues; if you don't mind I'll leave that with you. I did however create a ticket for it with all the details I could find: LB-1239
      • 2023-03-21 08052, 2023

      • BrainzBot
      • 2023-03-21 08053, 2023

      • BrainzBot
        LB-1239: API documentation builds are broken https://tickets.metabrainz.org/browse/LB-1239
      • 2023-03-21 08040, 2023

      • akshaaatt
      • 2023-03-21 08004, 2023

      • akshaaatt
      • 2023-03-21 08006, 2023

      • jasje
        akshaaatt: how do other website do that on app login?
      • 2023-03-21 08023, 2023

      • yvanzo
        zas: announcing for 16:45 UTC then
      • 2023-03-21 08031, 2023

      • zas
        ok
      • 2023-03-21 08000, 2023

      • jasje
        like other apps don't usually redirect user to a webpage
      • 2023-03-21 08013, 2023

      • jasje
        what auth is that?
      • 2023-03-21 08037, 2023

      • monkey
        Actually lucifer mayhem I think I figured it out in the end. Opening a PR.
      • 2023-03-21 08058, 2023

      • jivte joined the channel
      • 2023-03-21 08021, 2023

      • akshaaatt
        I just checked and we save the refresh token in local storage and no users can just get it jasje
      • 2023-03-21 08024, 2023

      • akshaaatt
        Which is fine
      • 2023-03-21 08046, 2023

      • akshaaatt
        But I am unsure of when the refresh tokens we get from MB expire
      • 2023-03-21 08019, 2023

      • akshaaatt
        It would be a good practice to expire these once in every 30 days or so and have the user login again. So a login once a month
      • 2023-03-21 08024, 2023

      • jasje
        akshaaatt: my thought too since ive been using the same token for long time
      • 2023-03-21 08035, 2023

      • BrainzGit
        [listenbrainz-server] 14MonkeyDo opened pull request #2420 (03master…update-autohttp): LB-1239: Update sphinxcontrib httpdomain dependency https://github.com/metabrainz/listenbrainz-server…
      • 2023-03-21 08046, 2023

      • akshaaatt
        Anyway, no that we have this sorted
      • 2023-03-21 08050, 2023

      • akshaaatt
        now*
      • 2023-03-21 08007, 2023

      • akshaaatt
        Any other questions for CB integration jasje?
      • 2023-03-21 08037, 2023

      • jasje
        akshaaatt: the main one: oauth will be part of it right then?
      • 2023-03-21 08054, 2023

      • akshaaatt
        Yes. Doesn't seem much work
      • 2023-03-21 08004, 2023

      • akshaaatt
        Let me know if you think otherwise
      • 2023-03-21 08014, 2023

      • jasje
        akshaaatt: id love too
      • 2023-03-21 08025, 2023

      • jasje
        i don't want the app to be dependent of website
      • 2023-03-21 08027, 2023

      • monkey
        Thanks for reporting the issue with the docs jasje 👍
      • 2023-03-21 08021, 2023

      • jasje
        monkey: my pleasure
      • 2023-03-21 08027, 2023

      • akshaaatt
        I guess we won't be dependent now, right?
      • 2023-03-21 08038, 2023

      • monkey
        akshaaatt: Sorry I missed your question earlier. The API endpoint to get a fresh CB token is `/profile/music-services/critiquebrainz/refresh/`
      • 2023-03-21 08056, 2023

      • jivte has quit
      • 2023-03-21 08059, 2023

      • akshaaatt
        Thanks a lot monkey!
      • 2023-03-21 08008, 2023

      • monkey
        That's on the LB side
      • 2023-03-21 08030, 2023

      • jasje
        akshaaatt: yees
      • 2023-03-21 08036, 2023

      • jasje
        akshaaatt: the timeline should be only 12 weeks right?
      • 2023-03-21 08003, 2023

      • jasje
        its kinda getting big for that time
      • 2023-03-21 08040, 2023

      • jasje
        since its 350 hrs, add more weeks to the proposal?
      • 2023-03-21 08024, 2023

      • iconoclasthero__ has quit
      • 2023-03-21 08025, 2023

      • nexus
        I am solving the issue LB-812. Can i use third party libraries like enzyme?
      • 2023-03-21 08026, 2023

      • BrainzBot
        LB-812: Add tests for playlist feature React components https://tickets.metabrainz.org/browse/LB-812
      • 2023-03-21 08046, 2023

      • monkey
        Hi nexus ! We already use Enzyme in our test suite
      • 2023-03-21 08005, 2023

      • monkey
        However, we will be moving away from using it, as it is pretty much abandoned
      • 2023-03-21 08019, 2023

      • monkey
        For now though, that's how we're testing react components
      • 2023-03-21 08010, 2023

      • nexus
        Oh right.. okay then..i will try to not use it as you are anyways not using it in future
      • 2023-03-21 08027, 2023

      • akshaaatt
        I haven’t calculated the exact math yet jasje
      • 2023-03-21 08049, 2023

      • akshaaatt
        Do it as suits you
      • 2023-03-21 08024, 2023

      • monkey
        In preparation for our future move from enzyme to react-testing-library, if possible, try to avoid setting or asserting the state or props directly, and instead emulate user actions and then assert that the UI is doing what is expected
      • 2023-03-21 08008, 2023

      • monkey
        nexus: I think you'll have a very hard time without Enzyme ! Do use it, but prefer testing UI and user interaction rather than internal state of the component :)
      • 2023-03-21 08008, 2023

      • nexus
        Sure ..i'll try
      • 2023-03-21 08054, 2023

      • monkey
        The entire codebase is nothing but tests of the internal state of the component, so it's not a great example to follow
      • 2023-03-21 08015, 2023

      • monkey
        We do have a couple of tests I can point you to however. Give me one minute
      • 2023-03-21 08023, 2023

      • nexus
        Sure
      • 2023-03-21 08008, 2023

      • nexus55 joined the channel
      • 2023-03-21 08026, 2023

      • nexus has quit
      • 2023-03-21 08029, 2023

      • nexus55 is now known as nexus
      • 2023-03-21 08045, 2023

      • monkey
        nexus (or nexus55 ?) this test file is a good example where we test user interactions: https://github.com/metabrainz/listenbrainz-server…
      • 2023-03-21 08045, 2023

      • monkey
        Since it tests a functional component that uses hooks, we cannot touch the internals like the state.
      • 2023-03-21 08046, 2023

      • nexus
        thanks
      • 2023-03-21 08059, 2023

      • nexus
        that sure would be a lot helpful
      • 2023-03-21 08020, 2023

      • jasje
        akshaaatt: alrighty
      • 2023-03-21 08047, 2023

      • zas
        yvanzo: in 4 minutes I'll apply changes and reboot
      • 2023-03-21 08050, 2023

      • zas
        ok?
      • 2023-03-21 08056, 2023

      • yvanzo
        zas: no :D
      • 2023-03-21 08006, 2023

      • yvanzo
        16:45
      • 2023-03-21 08018, 2023

      • zas
        ah UTC....
      • 2023-03-21 08024, 2023

      • yvanzo
        yes
      • 2023-03-21 08002, 2023

      • zas
        :)
      • 2023-03-21 08022, 2023

      • yvanzo
        I checked every container, it seems fine to have brainzbot down for a few minutes, picard *beta* website too (prod website has a second container on zappa), mbspotify too.
      • 2023-03-21 08014, 2023

      • yvanzo
        For MB, I will just stop cron after it completed both on trille and aretha (for hourly json dumps incremental).
      • 2023-03-21 08024, 2023

      • jivte joined the channel
      • 2023-03-21 08026, 2023

      • d4rkie joined the channel
      • 2023-03-21 08006, 2023

      • d4rk has quit
      • 2023-03-21 08045, 2023

      • zas
        k
      • 2023-03-21 08039, 2023

      • yvanzo
        alastairp, lucifer: crontab -l says that critiquebrainz-cron-prod has currently no crontab (for root and critiquebrainz users).
      • 2023-03-21 08042, 2023

      • jivte has quit
      • 2023-03-21 08039, 2023

      • yvanzo
        The file /etc/cron.d/critiquebrainz is present but it is probably not parsed.
      • 2023-03-21 08051, 2023

      • yvanzo
        nvm, log files show that it ran daily as expected.
      • 2023-03-21 08031, 2023

      • yvanzo
        I thought that 'crontab -l' would list jobs from this file too.
      • 2023-03-21 08002, 2023

      • nexus has quit
      • 2023-03-21 08006, 2023

      • lucifer
        yvanzo: so all fine?
      • 2023-03-21 08016, 2023

      • yvanzo
        yes :)
      • 2023-03-21 08036, 2023

      • atj
        yvanzo: why would you think that? it's far too logical!
      • 2023-03-21 08000, 2023

      • yvanzo
        :D
      • 2023-03-21 08015, 2023

      • jasje
        monkey: how do i use `/profile/music-services/critiquebrainz/refresh/` :P
      • 2023-03-21 08036, 2023

      • jasje
        like its a POST method
      • 2023-03-21 08042, 2023

      • jasje
        but base url?
      • 2023-03-21 08005, 2023

      • atj
      • 2023-03-21 08014, 2023

      • monkey
      • 2023-03-21 08021, 2023

      • monkey
        Post request
      • 2023-03-21 08049, 2023

      • monkey
      • 2023-03-21 08053, 2023

      • monkey
        Nope.
      • 2023-03-21 08057, 2023

      • monkey
      • 2023-03-21 08006, 2023

      • jasje
        i was looking at it but cant seem to understand
      • 2023-03-21 08010, 2023

      • jasje
        bodY?
      • 2023-03-21 08020, 2023

      • monkey
      • 2023-03-21 08013, 2023

      • monkey
        There's no body
      • 2023-03-21 08038, 2023

      • jasje
        then how does it know who's cb account to get token of?
      • 2023-03-21 08027, 2023

      • monkey
        With cookies. I see that could be a problem if all you have is a token
      • 2023-03-21 08028, 2023

      • monkey
      • 2023-03-21 08055, 2023

      • atj
        API with cookie auth 🙃
      • 2023-03-21 08000, 2023

      • monkey
        The decorator @api_login_required here ensures the request is from an authenticated user
      • 2023-03-21 08045, 2023

      • monkey
        Yeah, they weren't meant to be used from outside the LB website
      • 2023-03-21 08044, 2023

      • jasje
        looks like akshaaatt can bridge the my lack of knowledge here
      • 2023-03-21 08056, 2023

      • jasje
        bridge my*
      • 2023-03-21 08032, 2023

      • yvanzo
        zas: all cron services stopped now
      • 2023-03-21 08010, 2023

      • zas
        ok, I'll apply changes and reboot in 4 mins
      • 2023-03-21 08017, 2023

      • lucifer
        jasje: that is not the intended way to use CB api.
      • 2023-03-21 08016, 2023

      • lucifer
        you should directly register an app in CB UI and then use it with OAuth.
      • 2023-03-21 08050, 2023

      • jasje
        lucifer: oh alrightyy
      • 2023-03-21 08013, 2023

      • jasje
        that solves it thanks monkey, lucifer!
      • 2023-03-21 08056, 2023

      • yvanzo
        atj: apparently it’s messy enough to create a business about it: https://cronitor.io/guides/how-to-list-all-cron-j…
      • 2023-03-21 08007, 2023

      • yvanzo
        zas: ok
      • 2023-03-21 08046, 2023

      • zas
        rebooting
      • 2023-03-21 08028, 2023

      • trolley has quit
      • 2023-03-21 08056, 2023

      • trolley joined the channel
      • 2023-03-21 08003, 2023

      • zas
        yvanzo: trille is back
      • 2023-03-21 08004, 2023

      • akshaaatt
        jasje: we’ll manage the cb token as we do the mb token currently
      • 2023-03-21 08032, 2023

      • akshaaatt
        As lucifer mentioned, register the app there and use it
      • 2023-03-21 08036, 2023

      • akshaaatt
        Ideally we should just have a MeB auth and provide it with the scopes we want to access from each service
      • 2023-03-21 08010, 2023

      • akshaaatt
        lucifer I could help with the meb oauth stuff if it’s not too big of a deal anymore
      • 2023-03-21 08050, 2023

      • akshaaatt
        We should just get it done and proceed with life. Otherwise, we’ll be stuck in an endless loop of rewriting the same logic again and again
      • 2023-03-21 08053, 2023

      • jasje
        earthquake just hit
      • 2023-03-21 08034, 2023

      • jasje
        akshaaatt: agreed
      • 2023-03-21 08056, 2023

      • jasje
      • 2023-03-21 08003, 2023

      • yvanzo
        !m zas
      • 2023-03-21 08003, 2023

      • BrainzBot
        You're doing good work, zas!
      • 2023-03-21 08011, 2023

      • yvanzo
        Tweeted about sites restoration.
      • 2023-03-21 08019, 2023

      • akshaaatt
        Yes jasje, that’s the one
      • 2023-03-21 08044, 2023

      • yvanzo
        Checked that cron services are back too. (They just started with containers.)
      • 2023-03-21 08013, 2023

      • jasje
        akshaaatt: alright adding to the proposal
      • 2023-03-21 08016, 2023

      • yvanzo
        Cgroup Driver: systemd / Cgroup Version: 2
      • 2023-03-21 08016, 2023

      • lucifer
        akshaaatt: there's lots of stuff to do about it. alastairp was going to take it up but probably a few weeks in that. but he may available for discussion sometime sooner, we can sketch out what work is pending and divideit accordingly.
      • 2023-03-21 08029, 2023

      • akshaaatt
        Awesome!
      • 2023-03-21 08000, 2023

      • BrainzGit
        [listenbrainz-server] 14amCap1712 merged pull request #2420 (03master…update-autohttp): LB-1239: Update sphinxcontrib httpdomain dependency https://github.com/metabrainz/listenbrainz-server…
      • 2023-03-21 08052, 2023

      • atj
        yvanzo: hallelujah
      • 2023-03-21 08004, 2023

      • yvanzo
        (almost forgot restarting json dump hourly cron on aretha)
      • 2023-03-21 08011, 2023

      • reosarevok
        ROpdebee: we got the following exception in Sentry: "Error: cannot call methods on artworkViewer prior to initialization; attempted to call method 'close'"
      • 2023-03-21 08024, 2023

      • reosarevok
        Previous click was "tbody > tr > td.ROpdebee_comparisonImage.edit-cover-art > button[type="button"]" :)
      • 2023-03-21 08050, 2023

      • reosarevok
        Just in case there's something somewhere that needs to be patient :)