aerogear / datasync-starter

GraphQL Low Code React and Node.js DataSync Application template
http://graphback.dev
MIT License
32 stars 38 forks source link

Memory leaks on subscription components. #432

Closed wtrocki closed 4 years ago

wtrocki commented 4 years ago

Feature Request

We need to subscribe to the data globally as a component is rendered with multiple subscriptions being active.

(node:59126) MaxListenersExceededWarning: Possible EventEmitter memory leak detected.

Also one of the reasons for https://github.com/aerogear/offix/issues/499

wtrocki commented 4 years ago

This happens only for the InMemoryPub sub. Looks like sample app subscribes multiple times, but we actually trying to resolve this problem directly in offix datastore so there is no sense to resolve it temporarily.

CC @kingsleyzissou

kingsleyzissou commented 4 years ago

@wtrocki I actually noticed this problem yesterday. It's our useSubscribeToMore hook, it is actually subscribing to the subscription multiple times rather than just once. I think it may need to be refactore... but, this approach will definitely change with the datastore.

wtrocki commented 4 years ago

Ok so this will be offix issue rather than datasync. I did not went deep. Maybe makes sense to create offix issue then - question if we resolve it is different topic

kingsleyzissou commented 4 years ago

I think it was a custom hook that we used in the DataSync starter. I've resolved it now, so we should be good. Also no need to create an issue in Offix, because this hook was just a helper that I created that wasn't very good.