-
Notifications
You must be signed in to change notification settings - Fork 4k
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
🐛 [firebase_storage] Upload hangs when app is backgrounded on macos #4513
Comments
Hi @pschuegr |
@markusaksli-nc https://github.com/pschuegr/firebase_upload This required the use of the audio_service plugin, so ryanheise/audio_service#477 may be relevant. |
Hi @pschuegr |
I wasn't able to easily reproduce without the audio_service plugin. Does using a third-party lib cause problems for you? |
Hi @pschuegr |
It's possible that this is an issue with the audio_service plugin, but given that there are a number of issues (ie #3671, #4267, #4108) filed about problems with background isolates in FlutterFire, I think there's also a reasonable chance that this is another effect of that. I'm unsure if the fix by @ened in #4209 would have any effect on cloud storage since it seems to be targeted at firestore. @ryanheise may have a better understanding of this, I'll see if I can bring it to his attention (not sure if tagging him is enough). Unfortunately I do not have time right now to dig in and see if I can reproduce this without using another plugin, it seems highly likely that I could do so using similar behaviour with background isolates. However, at minimum I think the firebase_storage package should do what it can to handle this more gracefully and indicate to the user that something has gone wrong. (Sorry my understanding of isolates and communication is not great). |
I would just contribute two quick points.
|
@ryanheise @pschuegr |
@TahaTesser I'm unconvinced that I can make this happen with less code than https://github.com/pschuegr/firebase_upload/blob/master/lib/main.dart and to be honest I am still not clear on why this is necessary, since the intent of a minimal reproduction is generally to avoid burning developer time trying to reproduce the problem. Can you explain? Apologies if this comes off as confrontational, but IMO figuring out the the answer to questions like "what else causes this problem? what is the underlying cause?" is best done by somebody who has an understanding of the code already. I'm under the impression that FlutterFire is a funded project, so presumably there is somebody whose job it is to do this already? Please correct me if I've misunderstood and this is a volunteer effort. Would it be preferable if I used the |
The code in firebase_storage is affected by the same bug that #4209 fixed in cloud_firestore: https://github.com/FirebaseExtended/flutterfire/blob/master/packages/firebase_storage/firebase_storage/ios/Classes/FLTFirebaseStoragePlugin.m#L104. This will for sure need some work and cleanup. IMO there is no need for further repro cases. @Salakar FYI |
It may be of interest to mention that I am moving audio_service away from the multi-FlutterEngine model and toward a single shared FlutterEngine model (see ryanheise/audio_service#415). There are just too many problematic plugins that don't know how to function correctly in the presence of multiple FlutterEngines. This move will help side step the problem in a big way, and in audio_service's case will also result in faster audio service startup times. (Although if your app uses other plugins that also create additional FlutterEngines, like android_alarm_manager, you will still have to face this larger issue head on.) |
Is there an update on a pr to fix this, or some workaround? I'm still facing this issue |
@andy-t-wang FYI, will take a look at this issue next. |
@ened Hey just checking in has this been fixed? |
This issue is not fixed yet, and how is the fix going ? |
Experiencing this issue too. |
Same issue here. |
same |
Anyone found a fix for this? |
To everyone saying "me too" or "any progress", please read the above response #4513 (comment) which asks:
That's where it's still at. If you would like to help move things forward, please do that. |
My project contains the following dependencies:
And whenever I try to upload a file it just hangs on ios, never returning the result for the upload even tho the file actually uploads (It works normally on android). When I remove the isolates related dependency it works just fine!
Is there a sample app for us to try that? |
No there isn't - that's the very thing that you are being asked to create yourself and provide a link to (if you want to help this bug progress). All the people who could potentially fix this are likely busy working on other bugs or features or apps that they are not going to divert their attention to this at least until someone provides a minimal reproduction project (or if you're lucky, the fix itself). |
FYI, it's very easy to create a small project which reproduces this problem which fits my definition of "minimal completely reproducible", and IIRC I did so (had to edit it out of the original bug report because it had some open firebase project that I didn't want to leave up), but because it used a third-party lib I assume the concern was that the bug could be in the third party lib and thus a waste of developer time to chase it. My instinct says that this is an issue with firebase_storage and how it interacts with isolates, but I have only a thin knowledge of Dart to start off with, so shrug take that for what it's worth. |
Hey @pschuegr. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Since there haven't been any recent updates here, I am going to close this issue. @pschuegr if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this. |
I'm currently experiencing the same issue.
Will hang on the await on iOs (Android works just fine). I've also tried streaming the response and it still doesn't work on iOs (again android works just fine). The biggest difference are:
It looks like no one is willing to work on this until a minimal complete reproducible code sample is provided, which is a bummer. I'll try to get one going so you can find the bug. |
The issue is not fixed then. Maybe leaving this comment will get it re-opened? |
Bug report
I am having trouble with my uploads hanging in a "running" state:
I trigger the upload this way, and the upload hangs (application remains responsive) and never completes. I checked the status of the UploadTask using the
snapshotEvents
stream: it emits a single TaskSnapshot with the staterunning
almost immediately and then nothing. Curiously, this only happens if I cmd-tab to a different application while waiting for the upload. If I sit in the app and wait, it completes just fine.Steps to reproduce
Expected behavior
Upload completes in a reasonable time frame (my test files were from 8k to 2.1mb, they would hang indefinitely or at least 30mins+).
When doing this while keeping the app in foreground, uploads were ~10-15s maximum.
Additional context
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
The text was updated successfully, but these errors were encountered: