I'm just seeing now that this is a Work revision. Is it possible that there is currently no way to add rel attributes for these relationships, and so the attributesSet value woudl be null, and not shown in the diff?
akashgp09
maybe i can test it again by adding this line to workRevision diff `relationshipSet.relationships.attributeSet.relationshipAttributes.value`
monkey
Ah, if it's not there that would 100% explain it
I thought you were using a series revision :p
So, yeah, that's definitely what it is
Otherwise these related models are not loaded
It ends up in `withRelated: includes` in the diffRevisions method
A Pail of Air is a relationship within that series entity.
monkey
Right, but the info I see is that of a workRevision, not a seriesRevision
To be clear, the revision in question will affect both the series and work entities, so for the same rev number you'll have a workRevision and a seriesRevision
So the top table is just the diff change paths, equivalent to the middle column of the second table (path) since there wasn't enough space to display it.
You'll see that attributeSetId has changed, along with the relationshipAttributes and their value
In the second table, the last two columns (lhs and rhs / left-hand side and right-hand side) show the value before and after the revision
Here's what I added to bookbrainz-site's src/server/routes/revison.js file:
So everything seems to be working okay as far as I can tell. The changes do need to be formatted and all that, but at least the diff has the appropriate changes I'm expecting to see.
So I think maybe you were only looking at the workRevision diffs and not the seriesRevision diffs
akashgp09
oooooh yess 🤦
It is indeed showing the diffs for attributes. My bad i never tested it by editing the relationship.
Right. the diffs only show changes, and if values on both sides are null (for example relationships with no attributes = null attributeSet) it won't show anything
No worries, at least we know this part of the diff works as expected, and while in there we've discovered that the entityRevisions all need to have that `relationshipSet.relationships.attributeSet.relationshipAttributes.value`, that's good progress
akashgp09
> if values on both sides are null (for example relationships with no attributes = null attributeSet) it won't show anything
I guess even we add a new relationship( which have attributes value )[Kind ="n")] the diff doesn't include the path attributeSet.
monkey
Exactly
If you then add an attribute, there will be an attributeSet with an id , that id will be ≠ null and will show in the diffs
And same if you then change the attribute value: new attributeSetID and attribute value will show in the diff
akashgp09
But for newly added relationship(with attributes)[Kind="n"] will also have attributeSetId isn't it ?
monkey
I'm not sure currently the attributeSetId will show up in the diffs