Skip to content

[Bug] PutStreamAsync is never completed if there is no internet connection #1037

Open
@dacodelaac

Description

@dacodelaac
  • Unity editor version: 2019.4.21f1
  • Firebase Unity SDK version: 7.1.0
  • Source you installed the SDK: .unitypackage
  • Problematic Firebase Component: Storage
  • Other Firebase Components in use: Auth
  • Additional SDKs you are using:
  • Platform you are using the Unity editor on: Windows
  • Platform you are targeting: iOS, Android
  • Scripting Runtime: Mono and IL2CPP

I am using Firebase Storage and currently having an issue using PutStreamAsync when there is no internet connection. It seems like the task will never complete, even though I reduced MaxUploadRetryTime to 1 second or got the internet connection back. Task.Status is always WaitingForActivation

var task = storageReference.PutStreamAsync(ms, new MetadataChange()
{
    CustomMetadata = GetMetaData()
}, null, CancellationTokenSource.Token);

Editor log:

ApplicationException: GetFutureStatus(handle) == kFutureStatusPending
Rethrow as ApplicationException: backing->status != kFutureStatusComplete
Firebase.Storage.StorageReferenceInternal.PutBytesUsingMonitorControllerAsync (System.IntPtr buffer, System.UInt32 buffer_size, Firebase.Storage.MetadataInternal metadata, Firebase.Storage.MonitorControllerInternal monitor_controller) (at Z:/tmp/tmp.0Ryilsblb3/firebase/storage/client/unity/proxy/StorageReferenceInternal.cs:148)
Firebase.Storage.StorageReference.PutBytesUsingMonitorControllerAsync (System.IntPtr buffer, System.UInt32 bufferSize, Firebase.Storage.MetadataInternal metadata, Firebase.Storage.MonitorControllerInternal monitorController, System.Threading.CancellationToken cancellationToken) (at Z:/tmp/tmp.0Ryilsblb3/firebase/storage/client/unity/proxy/StorageReference.cs:276)
Firebase.Storage.StorageReference.PutBytesUsingCompletionSourceAsync (System.Byte[] bytes, Firebase.Storage.MetadataChange customMetadata, System.IProgress`1[T] progressHandler, System.Threading.CancellationToken cancelToken, System.Uri previousSessionUri, System.Threading.Tasks.TaskCompletionSource`1[TResult] completionSource) (at Z:/tmp/tmp.0Ryilsblb3/firebase/storage/client/unity/proxy/StorageReference.cs:309)
Firebase.Storage.StorageReference+<PutStreamAsync>c__AnonStorey7.<>m__0 () (at Z:/tmp/tmp.0Ryilsblb3/firebase/storage/client/unity/proxy/StorageReference.cs:457)
System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Threading.ThreadHelper.ThreadStart () (at <eae584ce26bc40229c1b1aa476bfa589>:0)
UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions