mohanadarafe / GuideMe

SOEN 390 | Winter 2020 | Mini Capstone
7 stars 5 forks source link

Fix Disconnection to dev app [memory leak] #221

Closed AlainJobs closed 4 years ago

AlainJobs commented 4 years ago

Issue

From time to time, we receive a too many pending callbacks in the console and it disconnects the tunnel from the app. There are two scenarios in which this warning is thrown and breaks the dev flow.

  1. When you go in a context not in the app (For instance, in Google Calendar, when trying to connect, this happens almost 90% of the time.
  2. When you have been testing the app in your device for too long.

    Screenshot

    image

Why is this important

As the warning suggests, we might have a memory leak in our app so this warning should be eliminated to avoid our app to really crash when release.

AlainJobs commented 4 years ago

Update

We will have to implement Redux...

In detail, we call the asynchronous calls in the useeffect, thus there is a massive number of calls that are being made every time the useEffects are running... Also, since it's AsyncStorage and it represents vallue that we do not want to lose, it creates a memory leak. In short, AsyncStorage should not be called infinitely, only when you need it.