#metabrainz

/

      • Cyna
        Nice... Seems easier than turning everything into async XD
      • 2020-04-14 10536, 2020

      • Cyna
        reosarevok: https://github.com/metabrainz/musicbrainz-server/… should be okay except for one comment which I've not set to resolved.
      • 2020-04-14 10555, 2020

      • Cyna
        I dont understand it much.. Rest were simple fix and have done that
      • 2020-04-14 10526, 2020

      • Cyna
        Mr_Monkey: I'd recommend upgrading the flow version for BB site. I've been facing some trouble with it lately on vscode requesting for version 0.75.0 and above which also crashes without an error log
      • 2020-04-14 10550, 2020

      • D4RK-PH0ENiX joined the channel
      • 2020-04-14 10552, 2020

      • Mr_Monkey
        Hm
      • 2020-04-14 10514, 2020

      • Mr_Monkey
        Yes, that seems sensible, but as part of another PR I suppose
      • 2020-04-14 10535, 2020

      • Cyna
        Yea that sounds better
      • 2020-04-14 10551, 2020

      • loujine_ is now known as loujine
      • 2020-04-14 10503, 2020

      • Cyna
        Please add an issue for in on BB, incase we forget it later on
      • 2020-04-14 10511, 2020

      • Mr_Monkey
        👍
      • 2020-04-14 10511, 2020

      • Mr_Monkey
        BB-455
      • 2020-04-14 10511, 2020

      • BrainzBot
      • 2020-04-14 10522, 2020

      • D4RK-PH0ENiX has quit
      • 2020-04-14 10533, 2020

      • D4RK-PH0ENiX joined the channel
      • 2020-04-14 10500, 2020

      • reosarevok
        Cyna: do you mean the "I'd probably just change the ->name to ->l_name in display data for now" bit?
      • 2020-04-14 10537, 2020

      • Cyna
        Yea
      • 2020-04-14 10546, 2020

      • reosarevok
      • 2020-04-14 10557, 2020

      • Cyna
        am confused as how will the translations be done
      • 2020-04-14 10509, 2020

      • reosarevok
        l_name is a translated name (translation made on the Perl side) so if you change name to l_name here, it will be passed already translated
      • 2020-04-14 10535, 2020

      • Cyna
        ohh then i dont have to make any changes to the React side of things right ?
      • 2020-04-14 10533, 2020

      • reosarevok
        Shouldn't have to, no
      • 2020-04-14 10507, 2020

      • Cyna
        reosarevok: https://github.com/metabrainz/musicbrainz-server/… made the changes and pushed them. Let me know if the translation works :)
      • 2020-04-14 10516, 2020

      • reosarevok
        Ok, let's test, thanks
      • 2020-04-14 10500, 2020

      • Cyna
        Thanks to docker I can work on two codebases at once without messing any dependency... Hehe
      • 2020-04-14 10508, 2020

      • Cyna
        Mr_Monkey: again facing the issue with transaction already completed
      • 2020-04-14 10521, 2020

      • Cyna
      • 2020-04-14 10505, 2020

      • Cyna
        so the delete is giving me the error of unhandled error
      • 2020-04-14 10535, 2020

      • Mr_Monkey
        Cyna: I think in handleDelete it might be better to stick either will .then() promises or async await. I suspect the issue you're running into is caused when some of your code is executed at the 'wrong' time and it would be a lot easier to see what's happening without the mix of both promise styles
      • 2020-04-14 10530, 2020

      • Mr_Monkey
        >so the delete is giving me the error of unhandled error
      • 2020-04-14 10530, 2020

      • Mr_Monkey
        What who where? If an error is thrown, the transaction is cancelled, which is why you'll see `transaction already completed`
      • 2020-04-14 10502, 2020

      • Cyna
        So should I change all to `async await` or `promises` ?
      • 2020-04-14 10523, 2020

      • Cyna
        I think async await would be a good choice 🤔
      • 2020-04-14 10524, 2020

      • Mr_Monkey
        Yep
      • 2020-04-14 10538, 2020

      • Mr_Monkey
        I agree. It's more work, but it's more readable.
      • 2020-04-14 10502, 2020

      • Mr_Monkey
        W'eve been slowly changing to async/await wherever we touch some old code
      • 2020-04-14 10532, 2020

      • reosarevok
        Cyna: left one comment, but otherwise looks ready to me, let's see what bitmap thinks :)
      • 2020-04-14 10510, 2020

      • prabal
        Mr_Monkey: u free for 10-15 min?
      • 2020-04-14 10532, 2020

      • Mr_Monkey
        prabal: I'm just about to have lunch, but I can ping you when I'm back
      • 2020-04-14 10547, 2020

      • prabal
        Yeah suree :)
      • 2020-04-14 10510, 2020

      • c1e0 joined the channel
      • 2020-04-14 10552, 2020

      • Cyna
        Hey prabal, do you have much experience with converting async to promises and stuff ?
      • 2020-04-14 10501, 2020

      • Cyna
      • 2020-04-14 10517, 2020

      • Cyna
      • 2020-04-14 10525, 2020

      • Cyna
        Are both of these equal ?
      • 2020-04-14 10535, 2020

      • c1e0_ has quit
      • 2020-04-14 10531, 2020

      • prabal
        Yes
      • 2020-04-14 10543, 2020

      • prabal
        Looks same to me
      • 2020-04-14 10521, 2020

      • prabal
        Can you show me newRevisionPromise?
      • 2020-04-14 10545, 2020

      • prabal
        I think you can use options withRelated : ['parents'] to fetch parents in one go
      • 2020-04-14 10549, 2020

      • prabal
        option*
      • 2020-04-14 10503, 2020

      • prabal
        No nvm, I saw the code. Ignore what I said
      • 2020-04-14 10521, 2020

      • Darkloke joined the channel
      • 2020-04-14 10551, 2020

      • Mr_Monkey
        prabal: Hi again ! I'm back. What's on your mind?
      • 2020-04-14 10527, 2020

      • prabal
        Hi
      • 2020-04-14 10545, 2020

      • prabal
        In one of the revisions, I only changed it's relationship, but the revision/id page was showing some other changes too - alias, etc.. it got me to some digging.
      • 2020-04-14 10546, 2020

      • prabal
        I think
      • 2020-04-14 10548, 2020

      • prabal
      • 2020-04-14 10555, 2020

      • prabal
        This is not correct
      • 2020-04-14 10524, 2020

      • prabal
        This is not giving the correct parent revision
      • 2020-04-14 10538, 2020

      • prabal
        Because parentIDs array will be having other ids too
      • 2020-04-14 10559, 2020

      • prabal
        ids which correspond to other entity's parent id
      • 2020-04-14 10508, 2020

      • Mr_Monkey
        The line `{bbid: this.get('bbid')}` should make sure we're only returning items for this entity though. Are you sure it's returning revisions for other BBIDs?
      • 2020-04-14 10514, 2020

      • prabal
        Yes
      • 2020-04-14 10523, 2020

      • prabal
        Because the interferernce is possible
      • 2020-04-14 10526, 2020

      • prabal
        Especially
      • 2020-04-14 10558, 2020

      • prabal
        example
      • 2020-04-14 10512, 2020

      • prabal
        You form a relation between jk rowling and hp in revision number 1
      • 2020-04-14 10513, 2020

      • Darkloke has quit
      • 2020-04-14 10529, 2020

      • prabal
        you modify jk rowling multiple 5 times
      • 2020-04-14 10549, 2020

      • prabal
        in revision number 7, you delete the relationship bw jk rowling and hp
      • 2020-04-14 10502, 2020

      • prabal
        parentId for jk rowling is actually 6
      • 2020-04-14 10528, 2020

      • prabal
        but because the parent of HP is 1, parentsIDs array will be having [1, 6]
      • 2020-04-14 10539, 2020

      • Mr_Monkey
        Yes, that's expected
      • 2020-04-14 10559, 2020

      • prabal
        While fetching parent for jk rowling
      • 2020-04-14 10504, 2020

      • prabal
        It can fetch revision number 1 too
      • 2020-04-14 10539, 2020

      • Mr_Monkey
        Through using this `parent()` function on the model, or through some other query?
      • 2020-04-14 10536, 2020

      • prabal
      • 2020-04-14 10546, 2020

      • prabal
        here i printed base and other(parent)
      • 2020-04-14 10549, 2020

      • prabal
        and saw this thing
      • 2020-04-14 10551, 2020

      • prabal
        the example which I gave, did you get it?
      • 2020-04-14 10550, 2020

      • Mr_Monkey
        I understood the example, but I would expect the parentIDs to be [1,6]. However authorRevision.parent() should only return 6
      • 2020-04-14 10509, 2020

      • prabal
        But it can return 1 also
      • 2020-04-14 10531, 2020

      • prabal
        because in revision 1 we edited jk rowling too
      • 2020-04-14 10550, 2020

      • Mr_Monkey
        And `.fetch(…` here returns multiple items? https://github.com/bookbrainz/bookbrainz-data-js/…
      • 2020-04-14 10520, 2020

      • Mr_Monkey
        I assume it should return only one item, authorRevision #6 in this case.
      • 2020-04-14 10521, 2020

      • prabal
        no this will return only 1 item right?
      • 2020-04-14 10543, 2020

      • prabal
        it can return authorRevision#1 too
      • 2020-04-14 10500, 2020

      • prabal
      • 2020-04-14 10533, 2020

      • prabal
        I changed revision only.. But it is showing I made changes in the Begin Area too. Because the parent revision wasn't fetched properly
      • 2020-04-14 10551, 2020

      • prabal
        i changed the relationships only*
      • 2020-04-14 10518, 2020

      • Mr_Monkey
        Could you try and replicate that on test.bb ?
      • 2020-04-14 10509, 2020

      • Mr_Monkey
        I think contrarily to what I said that in your example revision #7 only has one parent revision #6, so it will only try to fetch authorRevision #6 for that BBID.
      • 2020-04-14 10511, 2020

      • Mr_Monkey
      • 2020-04-14 10525, 2020

      • prabal
      • 2020-04-14 10530, 2020

      • Mr_Monkey
        great :à
      • 2020-04-14 10542, 2020

      • prabal
        Yes
      • 2020-04-14 10551, 2020

      • prabal
        But #1 will come from HP's parent
      • 2020-04-14 10522, 2020

      • prabal
        In revision number 7, we're editing HP and JKRowling's relationship
      • 2020-04-14 10548, 2020

      • prabal
        For HP, parentID is number 1, and JK rowling's id is 6.
      • 2020-04-14 10516, 2020

      • Mr_Monkey
        Ah, that's right.
      • 2020-04-14 10553, 2020

      • sumedh joined the channel
      • 2020-04-14 10547, 2020

      • Mr_Monkey
        prabal: Sure enough…
      • 2020-04-14 10552, 2020

      • Mr_Monkey
      • 2020-04-14 10509, 2020

      • rohitdandamudi has quit
      • 2020-04-14 10540, 2020

      • prabal
        i think this can be fixed by having some sort query in which if multiple parentID are there that satisfy bbid = this.bbid , pick the one with highest parentID
      • 2020-04-14 10557, 2020

      • Mr_Monkey
        Yep. oredr then return one.
      • 2020-04-14 10519, 2020

      • Mr_Monkey
        I was assuming this was returning only one, but I guess the whereIn clause might change that ? https://github.com/bookbrainz/bookbrainz-data-js/…
      • 2020-04-14 10546, 2020

      • prabal
        This is returning one only..
      • 2020-04-14 10558, 2020

      • prabal
        But not necessarily the correct one
      • 2020-04-14 10503, 2020

      • Mr_Monkey
        Hm.
      • 2020-04-14 10506, 2020

      • Mr_Monkey
        Good catch
      • 2020-04-14 10524, 2020

      • prabal
        Thanks :D
      • 2020-04-14 10526, 2020

      • Mr_Monkey
        And does it predictably return the same one?
      • 2020-04-14 10506, 2020

      • Mr_Monkey
        I mean, it doesn't matter. now to fix that.
      • 2020-04-14 10511, 2020

      • prabal
        I don't know..
      • 2020-04-14 10520, 2020

      • Mr_Monkey
        I do :)
      • 2020-04-14 10546, 2020

      • prabal
        So I'll try to fix it..
      • 2020-04-14 10554, 2020

      • prabal
        or do you want to look into this?
      • 2020-04-14 10501, 2020

      • Mr_Monkey
        Adding something like this might work:
      • 2020-04-14 10508, 2020

      • Mr_Monkey
      • 2020-04-14 10533, 2020

      • prabal
        Yeah...
      • 2020-04-14 10551, 2020

      • Mr_Monkey
        Or maybe orderBy 'asc', not sure how it currently decides which revision to return
      • 2020-04-14 10508, 2020

      • Mr_Monkey
        Do you wannna try adding that, see what happens?
      • 2020-04-14 10515, 2020

      • prabal
        Yeah I'll test it
      • 2020-04-14 10522, 2020

      • prabal
        and make a pr on bb-data
      • 2020-04-14 10536, 2020

      • Mr_Monkey
        yeah, if it work (fingers crossed)
      • 2020-04-14 10555, 2020

      • prabal
        hihi 🤞
      • 2020-04-14 10507, 2020

      • ruaok has quit
      • 2020-04-14 10547, 2020

      • alastairp has quit
      • 2020-04-14 10507, 2020

      • aidanlw17 has quit
      • 2020-04-14 10535, 2020

      • ruaok joined the channel
      • 2020-04-14 10519, 2020

      • aidanlw17 joined the channel
      • 2020-04-14 10537, 2020

      • alastairp joined the channel
      • 2020-04-14 10511, 2020

      • c1e0_ joined the channel
      • 2020-04-14 10558, 2020

      • c1e0 has quit
      • 2020-04-14 10539, 2020

      • c1e0_ has quit
      • 2020-04-14 10541, 2020

      • reosarevok
        yvanzo: are you around?
      • 2020-04-14 10555, 2020

      • reosarevok
        I'm not sure how to test the local sort issue you mentioned on my PRs
      • 2020-04-14 10534, 2020

      • sumedh has quit
      • 2020-04-14 10543, 2020

      • sumedh joined the channel
      • 2020-04-14 10542, 2020

      • CatQuest
        you cant sort by area or rating either
      • 2020-04-14 10537, 2020

      • CatQuest
        also a nit-pick: https://beta.musicbrainz.org/collection/3c63b602-… for "ascending" like here on the name I would put "▾" not "▴" (and visa versa)
      • 2020-04-14 10556, 2020

      • CatQuest
        it's what my brain expects, "▾" for "ABC" and "▴" for "CBA"
      • 2020-04-14 10524, 2020

      • CatQuest
        reosarevok
      • 2020-04-14 10538, 2020

      • rohitdandamudi joined the channel
      • 2020-04-14 10537, 2020

      • Wizzup_ has quit
      • 2020-04-14 10543, 2020

      • Wizzup joined the channel
      • 2020-04-14 10544, 2020

      • Darkloke joined the channel
      • 2020-04-14 10554, 2020

      • Cyna