SkygearIO / skygear-SDK-iOS

Skygear SDK for iOS
https://skygear.io
Other
10 stars 28 forks source link

Completion handler not called if skygear server died during uploadAsset operation #239

Closed kiootic closed 5 years ago

kiootic commented 6 years ago

Steps to reproduce: Kill skygear server during a uploadAsset operation

Possible cause: Early return in SKYPostAssetOperation.handleRequestCompletionWithData

Steven-Chan commented 6 years ago

@kiootic Please provide some sample code, thanks.

kiootic commented 6 years ago
            Logger.debug("enter uploadAsset")
            self.container.privateCloudDatabase.uploadAsset(SKYAsset(data: data)) { asset, error in
                Logger.debug("callback uploadAsset")
            }

When skygear server is killed during uploadAsset, the first log can be seen but second log cannot be seen.

Steven-Chan commented 6 years ago

Steps to reproduce in local development setup:

  1. Set breakpoint at SKYDatabase.m line: 703, i.e. creating SKYPostAssetOperation
  2. Call skygear database uploadAsset, the program should pause at the breakpoint
  3. Kill skygear server

postAssetCompletionBlock does not get call as expected.