Closed KrisDavie closed 3 years ago
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:
https://github.com/aertslab/SCope/blob/3821798914b3fefaf2722c74a736e16a335451a0/src/components/Search/FeatureSearchBox.tsx#L117
This will render the FeatureSearchBox
component and since selected
is now defined, Legacy.updateFeature
will be called:
https://github.com/aertslab/SCope/blob/3821798914b3fefaf2722c74a736e16a335451a0/src/components/Search/FeatureSearchBox.tsx#L158-L164
The two problematic listeners are getting called inside setActiveFeature
function:
https://github.com/aertslab/SCope/blob/69a2bff27e8452810bcee69d8b2bee117990224b/src/components/common/API.jsx#L424-L428
and are the following:
From Regulon.jsx
:
https://github.com/aertslab/SCope/blob/3821798914b3fefaf2722c74a736e16a335451a0/src/components/pages/Regulon.jsx#L26-L28
From ViewSideBar.jsx
:
https://github.com/aertslab/SCope/blob/3821798914b3fefaf2722c74a736e16a335451a0/src/components/common/ViewerSidebar.jsx#L60-L67
Each of them will trigger a re-render of FeatureSearchBox
and since !R.equals(currentFeature, legacyFeature)
is true
:
hence the infinite loop
Fixed in #451
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.