Page MenuHomePhabricator

Duplicated graph doesn't display anymore
Closed, ResolvedPublicBUG REPORT

Description

Since the upgrade to vega 5, a duplicated graph doesn't display correctly anymore

Steps to replicate the issue (include links if applicable):

What happens?:

The second graph is not displayed correctly:

graph-nodisplay.png (283×660 px, 9 KB)

What should have happened instead?:
The second graph should be identical to the first one.

Software version (skip for WMF-hosted wikis like Wikipedia):
This issue is present on Graph commit 61067091957b3427950157a10dcfd003e6f38cc5; it was working as expected on Graph commit 405a640b22f2108be4892fa35111c8ecb5e75410.

Event Timeline

Both graphs use the same graph ID, which is probably causing issues? The ID is generated with $hash = sha1( FormatJson::encode( $data, false, FormatJson::ALL_OK ) ); in includes/ParserTag.php. I don't know if that is needed.

It was already the case that it used the same graph ID (that's why I had that test case on my local wiki ;) ), and yeah, that'd be my guess as well that this is what causing the issue. Identical graphs are not without their issues, see T312242 and related.
The hash on the data may not be necessary per se, but it feels like a reasonable solution to ensure ID unicity (... up to using the same data, but then the same graph would be rendered, so it "shouldn't be a problem™") and ID stability, I guess.

Jdlrobson subscribed.

Looks like the mapSchema has side effects. Thanks for the bug report!

Change 911937 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/Graph@master] Map schema should not have side effects and map marks field

https://gerrit.wikimedia.org/r/911937

Change 911937 merged by jenkins-bot:

[mediawiki/extensions/Graph@master] Map schema should not have side effects and map marks field

https://gerrit.wikimedia.org/r/911937

This is now working. Thanks for the report! Your testing is extremely valuable to us right now!

Change 911802 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/Graph@wmf/1.41.0-wmf.6] Map schema should not have side effects and map marks field

https://gerrit.wikimedia.org/r/911802

Change 911802 abandoned by Jdlrobson:

[mediawiki/extensions/Graph@wmf/1.41.0-wmf.6] Map schema should not have side effects and map marks field

Reason:

Too many patches would need to be backported for wmf6 so I am shifting focus to wmf7

https://gerrit.wikimedia.org/r/911802