-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[android][database] Remove all db references and listeners onCatalystInstanceDestroy #1535
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1535 +/- ##
=======================================
Coverage 70.15% 70.15%
=======================================
Files 71 71
Lines 1833 1833
=======================================
Hits 1286 1286
Misses 547 547 |
@Salakar Looks like a good solution, but I think we should have this same solution and for iOS ? |
@barbarosh I'd like someone to test and confirm this works before I look into iOS - I'm not even sure if iOS has the same issue - can someone confirm? |
@Salakar onHostDestroy isn't calling on a restart js part in dev mode. |
@barbarosh have just checked and looks like that's an RN problem I think: facebook/react-native#9773 If someone could push up a cloneable repo that reproduces this it'd save me time and I can look into somehow working around it. This change on this PR is most likely still be required either way. |
Am trying something else - will push to this branch for you guys to test, give me a few mins. |
@Salakar I tried this code
It worked, bot I worried, it code can clearify new subscriptions while starting new JS instance ? |
Guys in this method removeAllEventListeners() thers is a if statement with condition hasListeners. |
Can you locally replace the two files I've just changed again and let me know how you get on? |
@Salakar Sorry but didn't work. Same problem no data after hot reload. |
@shashankvaibhav can you comment out the highlighted lines below (the iterator section) and try: |
@Salakar Didn't work. |
Worked for @barbarosh though 🙈 Can you push up a reproducible project that I can clone and work off please to save me some time - and I can take a look |
@Salakar I tried this PR out and even commented out the lines you mentioned above. Still the same issue |
@armanatz ok thanks for confirming also - I'll try reproduce on my end - will take time to setup though, I've also not experienced this issue myself so am not 100% sure if this is even the cause. |
@Salakar for me worked solution with onCatalystInstanceDestroy callback, but i tried only for reload event from dev menu, I not check with hot reload |
@barbarosh Interesting because this PR doesn't work for me with dev menu reload |
@barbarosh @armanatz what RN versions are you each using? |
@Salakar I am on |
@Salakar I am on [email protected] and [email protected]. |
See new PR #1619 |
Potential fix for #1498
cc @pistou , @barbarosh , @shashankvaibhav