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

Address JS error in visualizer when displaying the dependency graph #2042

Merged
merged 2 commits into from
Mar 6, 2017

Conversation

amarco90
Copy link
Contributor

Description

In the current version of the visualizer an error raises when switching to the Dependency Graph tab. To reproduce it just load the visualizer page, open a javascript console and go to the Dependency Graph tab.

screen shot 2017-02-25 at 12 16 08 pm

The error is happening because the variable visType is not defined. The variable fragmentQuery.visType in the function call in the next line is not defined either.

To address the issue I removed the function calls that were raising an error because of undeclared variables. The function calls were anyway not required, because line 506 modifies the state of the address bar. An event listening to changes on the address bar takes care of updating the visualization graph.

Motivation and Context

I think the error was introduced in this commit.

Have you tested this? If so, how?

I tested the fix locally, now the visualizer does not produce errors in the dependency graph tab and still works normally.

@mention-bot
Copy link

@amarco90, thanks for your PR! By analyzing the history of the files in this pull request, we identified @daveFNbuck, @nmb10 and @riga to be potential reviewers.

@riga
Copy link
Contributor

riga commented Feb 25, 2017

It wasn't my commit, but I recently stumbled upon this as well. I added an inline comment.

@@ -504,9 +504,6 @@ function visualiserApp(luigi) {

$('input[name=vis-type]').on('change', function () {
changeState('visType', $(this).val());

initVisualisation(visType);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both initVisualization and updateVisType should be invoked here. Maybe this way:

var visType = $(this).val();
changeState('visType', visType);
initVisualisation(visType);
updateVisType(visType);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would work but then updateVisType would be called twice since processHashChange also calls it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, you're right.

@Tarrasch
Copy link
Contributor

Tarrasch commented Mar 5, 2017

Is this ready to be merged?

@amarco90
Copy link
Contributor Author

amarco90 commented Mar 5, 2017

I think it is. Do you agree @riga ?

@Tarrasch Tarrasch merged commit 4b6f25e into spotify:master Mar 6, 2017
@Tarrasch
Copy link
Contributor

Tarrasch commented Mar 6, 2017

Thanks for this patch @amarco90!

@riga
Copy link
Contributor

riga commented Mar 6, 2017

@amarco90 Sorry I'm a bit late, but yes, your changes work for me.

This was referenced Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants