paritytech / polkassembly

Polkassembly now has a new home:
https://github.com/Premiurly/polkassembly
Apache License 2.0
30 stars 37 forks source link

api bump v-3.2.1 #1089

Closed niklabh closed 3 years ago

niklabh commented 3 years ago
Tbaut commented 3 years ago

don't hesitate to seek help and open an issue on https://github.com/polkadot-js/api/ if there's anything you can't solve. I'll take a quick look now.

Tbaut commented 3 years ago

What I did:

Please make sure to triple-check the changes I made with the id params, and the councilMembers array. These were normal lint issues that came up because of the bump.

edit: a dependency bump needs to be made regularly, and many are still lacking. Not to mention the other projects such as auth-server that I didn't touch.

niklabh commented 3 years ago

Thankyou very much

niklabh commented 3 years ago

There is memory leak/infinte loop in polkadot.js api or react-context.

This example can reproduce the issue

import React, {useContext, useEffect} from 'react';

import { ApiPromiseContext } from '@substrate/react-context';

function App() {
  const { api, isApiReady } = useContext(ApiPromiseContext);

  useEffect(() => {

        if (!isApiReady){
            return;
        }

    api.query.timestamp.now().then(console.log);

  }, [api, isApiReady]);

  return (
    <div>
      Memory leak
    </div>
  );
}

export default App;

Screenshot from 2021-01-18 02-23-48

Tbaut commented 3 years ago

@substrate/react-context has been upgraded afair, can you try with the earlier version? This is what changed, and could very well be the origin of the problem https://github.com/paritytech/substrate-js-utils/commit/717298952f6bdb8552232bd2246fc60cef2753d9#diff-8b186436e62efe7d5dd561abd16d87eddfb98281d8cbf8aef2ab6f6b0aabab86