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

Selecting a regulon causes an infinite loop in the backend #435

Closed
KrisDavie opened this issue May 21, 2021 · 2 comments
Closed

Selecting a regulon causes an infinite loop in the backend #435

KrisDavie opened this issue May 21, 2021 · 2 comments
Assignees
Labels
backend develop Issues specific to the develop branch major bug

Comments

@KrisDavie
Copy link
Contributor

After selecting a regulon on the regulon tab, after loading the 3 plotsm the backend ends up in a (possibly) infinite loop reloading the loom file and causes performance issues.

@dweemx
Copy link
Contributor

dweemx commented Jun 23, 2021

This issue is not trivial and is in fact a double infinite loop each triggered by a listener function call.

When a user select a result from the Search results, it dispatches the following action:

dispatch(Action.select(props.field, selection));

This will render the FeatureSearchBox component and since selected is now defined, Legacy.updateFeature will be called:

LegacyAPI.updateFeature(
legacyFeatureIndex,
props.filter,
state.selected.title,
state.selected.category,
state.selected.description
);

The two problematic listeners are getting called inside setActiveFeature function:

this.getMaxScale(featureId, (customValues, maxValues) => {
(this.featureChangeListeners[page] || []).forEach((listener) => {
listener(selectedFeatures, featureId, customValues, maxValues);
});
});

and are the following:

  • From Regulon.jsx:

    this.activeFeaturesListener = (features, featureID) => {
    this.setState({ activeFeatures: features });
    };

  • From ViewSideBar.jsx:

    this.activeFeaturesListener = (features, id) => {
    this.props.onActiveFeaturesChange(features, id);
    console.log('ViewerSidebar features changed:', features, id);
    this.setState({
    activeFeatures: features,
    activeTab: parseInt(id) + 1,
    });
    };

Each of them will trigger a re-render of FeatureSearchBox and since !R.equals(currentFeature, legacyFeature) is true:
image

hence the infinite loop

dweemx added a commit that referenced this issue Jun 23, 2021
@dweemx dweemx mentioned this issue Jun 23, 2021
dweemx added a commit that referenced this issue Jun 23, 2021
dweemx added a commit that referenced this issue Jun 24, 2021
* Clear space in viewer controls of Gene page

* Fix bug viewer toolabar right spacing

* Fix regulon viewers not filling screen Closes #434

* Closes #435 Closes #441 Closes #442 Closes #443

* Remove unused imports

* Closes #436

* Closes #429

* Update package-lock files

* Position Viewer labels so that Viewrs do not overflow display

Labels on Viewer(s) cause an increase in column height causing the
Viewer canvas to overflow the display. This change positions the
labels _absolutely_ above the Viewer so that they do not take column
height.

* Formatting

Co-authored-by: James Collier <james.collier@vib.be>
@MaybeJustJames MaybeJustJames moved this from In progress to Done in SCope Maintainability Upgrade Jun 24, 2021
@MaybeJustJames
Copy link
Collaborator

Fixed in #451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend develop Issues specific to the develop branch major bug
Development

No branches or pull requests

3 participants