Not sure what that ends up doing, but maybe not push the other entities into the array, which might be why they're not being included in the revision
2020-04-14 10551, 2020
Cyna
Ohh so the function really takes an array... Can i get back in 30 mins. Lunch time for me 😅
2020-04-14 10501, 2020
Mr_Monkey
Sure thing. i'll keep looking at the PR
2020-04-14 10542, 2020
Mr_Monkey
actually it looks like `await array.push(…` still works, so while it needs to be corrected that's not the issue
2020-04-14 10541, 2020
CatQuest
ooh summer of docs, let's <s>do</s> try it!
2020-04-14 10521, 2020
ruaok
I prefer not to. right now we need to reduce the things we focus on, not increase them.
2020-04-14 10531, 2020
CatQuest
aw
2020-04-14 10504, 2020
reosarevok
Aww but also sensible
2020-04-14 10521, 2020
reosarevok
Because otherwise it'd be me doing it and I shouldn't take on more stuff
2020-04-14 10534, 2020
reosarevok
Cyna: will you have some time to look into the comments on your PRs soonish? :)
2020-04-14 10541, 2020
reosarevok
Would be sweet to get those merged
2020-04-14 10528, 2020
shivam-kapila
ruaok: Hii. I am ready for some code today. From where should I pick up?
2020-04-14 10539, 2020
Cyna
Sure... Sorry for the delay reosarevok . I'll try to get them ready by tonight
2020-04-14 10509, 2020
reosarevok
Cyna: no worries! If you're busy you're busy
2020-04-14 10518, 2020
reosarevok
Not like we pay you for this :p
2020-04-14 10545, 2020
Cyna
Lol
2020-04-14 10549, 2020
ruaok
shivam-kapila: great. start by taking a look at the failing integration tests for apis.
2020-04-14 10504, 2020
ruaok
the most recent code is on the timescale branch.
2020-04-14 10552, 2020
shivam-kapila
Got it. Picking it up. Thanks
2020-04-14 10539, 2020
Cyna
I'm back Mr_Monkey.
2020-04-14 10500, 2020
Mr_Monkey
Cyna: 👋
2020-04-14 10529, 2020
Cyna
I've done console log to check whether the other entites are getting filled. They are
2020-04-14 10549, 2020
Mr_Monkey
Yep, the issue is somewhere else
2020-04-14 10553, 2020
Cyna
Maybe I'll have to add async to all the promises
2020-04-14 10530, 2020
Cyna
That would be cause, otherEntites are initially [] and get filled asyncronously
2020-04-14 10535, 2020
Mr_Monkey
Well, hang on a minute before starting that
2020-04-14 10542, 2020
Cyna
ohh
2020-04-14 10506, 2020
Mr_Monkey
I think there's a piece of the puzzle missing: here (https://github.com/bookbrainz/bookbrainz-site/pul…) you're setting a revision with the same dataID that they had before, which doesn't look right to me if you're changing their data
2020-04-14 10518, 2020
Darkloke has quit
2020-04-14 10504, 2020
Mr_Monkey
this block looks odd to me generally. I can't follow what's happening
I don't think I tried saving multiple models like that, maybe that's where the issue comes from?
2020-04-14 10540, 2020
Mr_Monkey
But also this crucial detail:
2020-04-14 10534, 2020
Mr_Monkey
The `RevisionModel` here refers to, say a `WorkRevision` if you're deleting a Work entity. If that work has an Author relationship, you're trying to save a WorkRevision for the Author entity, which won't work
2020-04-14 10548, 2020
Mr_Monkey
Same for RevisionHeader
2020-04-14 10559, 2020
Mr_Monkey
Sorry, `HeaderModel`
2020-04-14 10535, 2020
Mr_Monkey
Let me run the code locally and try it with a Work -> Work relationship
*Oh. That means we did not translate it in our current edit code (because it sucks)
2020-04-14 10511, 2020
Cyna >*Oh. That means we did not translate it in our current edit code (because it sucks)
2020-04-14 10516, 2020
reosarevok
But we should be able to do lp_attributes(type.name, 'release_group_primary_type')
2020-04-14 10523, 2020
Cyna
ok I'll fix it
2020-04-14 10534, 2020
reosarevok
Check it actually works, but I think it should anyway
2020-04-14 10504, 2020
Cyna
I dont have any translation setup.. I'll be relying on CI for that 😅
2020-04-14 10544, 2020
reosarevok
I don't think CI really does translation much but I can check it myself when testing
2020-04-14 10548, 2020
Cyna
Mr_Monkey: as for the above block. I was in the assumtion that newEntityRevisionPromise creates revisions for entities that are passed into it as an array. so first I passed the main `entity` and then the array of other entities. The dataId of main has to be null as in the other codes but the otherEntities follow the same dataId
2020-04-14 10502, 2020
Cyna
reosarevok: That would be great !
2020-04-14 10513, 2020
reosarevok
I mean, if it did test for it properly we would already translate it ;p
2020-04-14 10514, 2020
Cyna
Give me another 5 mins and I'll push the PR
2020-04-14 10519, 2020
reosarevok
Ok, no worries!
2020-04-14 10535, 2020
Mr_Monkey
Cyna: (If you need to do one thing at a time we can talk about this at a later point :) ) Well, the otherEntities would need a new dataId since they've been modified (in this case only the relationshipSetId).
2020-04-14 10515, 2020
Mr_Monkey
There is a utility that would save you some trouble I think: `saveEntitiesAndFinishRevision` that handles saving, parent revision, notes and a few other things in one go
2020-04-14 10507, 2020
Cyna
> If you need to do one thing at a time we can talk about this at a later point :)
2020-04-14 10535, 2020
Cyna
Thanks but I need to get good with the codebase before the gsoc period to even stand a chance to complete it. So I'm working extra hard
2020-04-14 10542, 2020
D4RK-PH0ENiX has quit
2020-04-14 10504, 2020
Cyna
> saveEntitiesAndFinishRevision
2020-04-14 10515, 2020
Cyna
I'll have a look at the code and get back in sometime
2020-04-14 10513, 2020
Mr_Monkey
OK. Don't hesitate to ping me if you have questions, but the gist of it is: make modifications to the entities (you've done that) and send all the entities to saveEntitiesAndFinishRevision and that should be it.
2020-04-14 10537, 2020
Mr_Monkey
You might have to `.set(dataId: null)` on the mainEntity, or something like that.