kesha-antonov / react-native-background-downloader

About A library for React-Native to help you download large files on iOS and Android both in the foreground and most importantly in the background.
https://www.npmjs.com/package/@kesha-antonov/react-native-background-downloader
Other
26 stars 3 forks source link

Downloader breaking every other time you reload in debugger #4

Open sjchristi opened 2 months ago

sjchristi commented 2 months ago

I'm running on ios simulator, and I noticed that every other time the app is reloaded, the downloader stops working.

It looks like this is being caused because there are two instances of the downloader allocated at once, and one of the instances which receives all the messages has an invalid bridge so none of the events are forwarded on to javascript.

I'm not sure why this is the case; it seems that when the app is reloaded, it only deallocates the instances of the module every other time. Not sure if this is a lower level react native bug or something else.

Thought I'd raise this here in case anyone else is wondering why it seems to be breaking sometimes when developing.

kesha-antonov commented 2 months ago

Hi Did you try on real device?

sjchristi commented 2 months ago

on a full release bulid i haven't noticed htis happening on device, but i have seen it on device with a debug build where you can reload your app dynamically from react native.

kesha-antonov commented 2 months ago

Yes, I noticed this problem also, maybe it's related to Fast Refresh I will look into it