@@ -369,7 +369,7 @@ -(void)dbUploadFile:(NSString *)file to:(NSString *)path mode:(DBFILESWriteMode
369369
370370 // uploadUrl:path inputUrl:file
371371 weakify (self);
372- [[[[DBClientsManager authorizedClient ].filesRoutes uploadUrl: path mode: mode autorename: @NO clientModified: nil mute: @NO propertyGroups: nil strictConflict: @NO inputUrl: file]
372+ [[[[DBClientsManager authorizedClient ].filesRoutes uploadUrl: path mode: mode autorename: @NO clientModified: nil mute: @NO propertyGroups: nil strictConflict: @NO contentHash: nil inputUrl: file]
373373 // Track response with result and error
374374 setResponseBlock: ^(DBFILESFileMetadata * _Nullable response, DBFILESUploadError * _Nullable routeError, DBRequestError * _Nullable error) {
375375 strongify (self);
@@ -414,7 +414,7 @@ -(void)dbUploadFile:(NSString *)file to:(NSString *)path mode:(DBFILESWriteMode
414414 // unable to upload file, show error
415415 else {
416416 NSBlockOperation *retryOperation = [NSBlockOperation blockOperationWithBlock: ^{ [self dbUploadFile: file to: path mode: mode]; }];
417- [self handleChunkUploadWithLookupError :nil finishError: nil uploadError: nil networkError: error retryBlock: retryOperation];
417+ [self handleChunkUploadWithRouteError :nil finishError: nil uploadError: nil networkError: error retryBlock: retryOperation];
418418 }
419419 }]
420420
@@ -455,7 +455,7 @@ -(void)dbUploadLargeFile:(NSString *)file to:(NSString *)path mode:(DBFILESWrite
455455 [self uploadNextChunk ];
456456 } else {
457457 NSBlockOperation *retryOperation = [NSBlockOperation blockOperationWithBlock: ^{ [self dbUploadLargeFile: file to: path mode: mode]; }];
458- [self handleChunkUploadWithLookupError :nil finishError: nil uploadError: nil networkError: networkError retryBlock: retryOperation];
458+ [self handleChunkUploadWithRouteError :nil finishError: nil uploadError: nil networkError: networkError retryBlock: retryOperation];
459459 }
460460 }] setProgressBlock: ^(int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite) {
461461 [self updateProgressBytesWritten: bytesWritten totalBytesWritten: totalBytesWritten totalBytesExpectedToWrite: totalBytesExpectedToWrite];
@@ -483,21 +483,21 @@ -(void)uploadNextChunk{
483483 }
484484 } else {
485485 NSBlockOperation *retryOperation = [NSBlockOperation blockOperationWithBlock: ^{ [self uploadNextChunk ]; }];
486- [self handleChunkUploadWithLookupError :nil finishError: routeError uploadError: nil networkError: networkError retryBlock: retryOperation];
486+ [self handleChunkUploadWithRouteError :nil finishError: routeError uploadError: nil networkError: networkError retryBlock: retryOperation];
487487 }
488488 }] setProgressBlock: ^(int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite) {
489489 strongify (self);
490490 [self updateProgressBytesWritten: bytesWritten totalBytesWritten: totalBytesWritten totalBytesExpectedToWrite: totalBytesExpectedToWrite];
491491 }];
492492 } else {
493- [[[[DBClientsManager authorizedClient ].filesRoutes uploadSessionAppendV2Data: cursor inputData: nextChunkToUpload] setResponseBlock: ^(DBNilObject * _Nullable result, DBFILESUploadSessionLookupError * _Nullable routeError, DBRequestError * _Nullable networkError) {
493+ [[[[DBClientsManager authorizedClient ].filesRoutes uploadSessionAppendV2Data: cursor inputData: nextChunkToUpload] setResponseBlock: ^(DBNilObject * _Nullable result, DBFILESUploadSessionAppendError * _Nullable routeError, DBRequestError * _Nullable networkError) {
494494 strongify (self);
495495 if (result) {
496496 self->offset += self->nextChunkToUpload .length ;
497497 [self uploadNextChunk ];
498498 } else {
499499 NSBlockOperation *retryOperation = [NSBlockOperation blockOperationWithBlock: ^{ [self uploadNextChunk ]; }];
500- [self handleChunkUploadWithLookupError : routeError finishError: nil uploadError: nil networkError: networkError retryBlock: retryOperation];
500+ [self handleChunkUploadWithRouteError : routeError finishError: nil uploadError: nil networkError: networkError retryBlock: retryOperation];
501501 }
502502 }] setProgressBlock: ^(int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite) {
503503 strongify (self);
@@ -508,11 +508,11 @@ -(void)uploadNextChunk{
508508
509509#pragma mark - Upload File Helper
510510// Helper to Handle Chunk Upload Error
511- -(void )handleChunkUploadWithLookupError : (DBFILESUploadSessionLookupError * _Nullable)lookupError
512- finishError : (DBFILESUploadSessionFinishError * _Nullable)finishError
513- uploadError : (DBFILESUploadError * _Nullable)uploadError
514- networkError : (DBRequestError * _Nullable)networkError
515- retryBlock : (NSBlockOperation *)operation {
511+ -(void )handleChunkUploadWithRouteError : (DBFILESUploadSessionAppendError * _Nullable)routeError
512+ finishError : (DBFILESUploadSessionFinishError * _Nullable)finishError
513+ uploadError : (DBFILESUploadError * _Nullable)uploadError
514+ networkError : (DBRequestError * _Nullable)networkError
515+ retryBlock : (NSBlockOperation *)operation {
516516 // Handle Internet Connection Lost
517517 if (networkError && networkError.nsError .code == -1009 ) {
518518 self.lastfailedOperation = operation;
@@ -538,8 +538,8 @@ -(void)handleChunkUploadWithLookupError:(DBFILESUploadSessionLookupError * _Null
538538 self.errorBlock (nil , YES );
539539
540540 // Handle Route and Network Errors
541- if (lookupError ) {
542- [DBErrorHandler handleUploadSessionLookupError: lookupError ];
541+ if (routeError ) {
542+ [DBErrorHandler handleUploadSessionAppendError: routeError ];
543543 } else if (finishError) {
544544 [DBErrorHandler handleUploadSessionFinishError: finishError];
545545 } else if (uploadError) {
0 commit comments