Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scatter fill regression #3168

Merged
merged 2 commits into from
Oct 26, 2018
Merged

Fix scatter fill regression #3168

merged 2 commits into from
Oct 26, 2018

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Oct 26, 2018

This PR fixes an unreleased regression originating from #3087. I'd like to get this in before the 1.42.0 release.

Scatter fills on master currently do not restyle correctly and lead to these logs:

image

but no failed tests. That's because those logs come from:

try {
shape.call(Color.fill, d[0].trace.fillcolor);
}
catch(e) {
Lib.error(e, s);
shape.remove();
}

which do not make failTest throw, leading to false-positive tests.


The first commit fixes and 🔒s the bug, and the second commit 🔪s that try-catch (which is at least 4 years old) which is probably a bit more dangerous, but I'm willing to take that chance. I hope @plotly/plotly_js agrees.

... by setting trace._ownfill on every linkTraces call,
    so we don't let relinkPrivateKeys mess things up.

    Previously, the scatter fill restyle test did not fail,
    but did log a error as Drawing.fillGroupStyle logs
    in a try-catch when things go wrong instead of errorring out.
@etpinard etpinard added bug something broken status: reviewable labels Oct 26, 2018
@alexcjohnson
Copy link
Collaborator

Good catch! I noticed those logs but studiously ignored them 🙈 - glad someone is paying more attention!!

The first commit fixes and 🔒s the bug

How does this 🔒 it?

the second commit 🔪s that try-catch ... which is probably a bit more dangerous, but I'm willing to take that chance.

Me too. We have enough tests at this point, don't worry about removing it. As evidenced here, a try/catch like this is more likely to paper over a problem than to provide useful behavior!

@etpinard
Copy link
Contributor Author

How does this it?

By spying on Lib.error.

@etpinard
Copy link
Contributor Author

... by I removed that spy in the second commit 1f3c10c as now the fillGroupStyle errors lead to failTest.

@alexcjohnson
Copy link
Collaborator

Got it, thanks! 💃

@etpinard etpinard merged commit 15afd7b into master Oct 26, 2018
@etpinard etpinard deleted the fix-scatter-fill-regression branch October 26, 2018 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants