@@ -151,7 +151,6 @@ class _FileManagerBase extends _SubManagerBase {
151151 this . _bytesAvailable = bytesAvailable ;
152152 this . _remoteFiles = _ArrayTools . arrayRemove ( this . _remoteFiles , fileName ) ;
153153 this . _uploadedEphemeralFileNames = _ArrayTools . arrayRemove ( this . _uploadedEphemeralFileNames , fileName ) ;
154- this . _updatePendingOperationsWithNewRemoteFiles ( ) ;
155154 }
156155 listener ( success , bytesAvailable , fileNames , errorMessage ) ;
157156 } ) ;
@@ -237,12 +236,6 @@ class _FileManagerBase extends _SubManagerBase {
237236 return ;
238237 }
239238
240- const msgVersion = this . _lifecycleManager . getSdlMsgVersion ( ) ;
241- const rpcVersion = new Version ( msgVersion . getMajorVersion ( ) , msgVersion . getMinorVersion ( ) , msgVersion . getPatchVersion ( ) ) ;
242- if ( ! file . isPersistent ( ) && ! this . hasUploadedFile ( file ) && new Version ( 4 , 0 , 0 ) . isNewerThan ( rpcVersion ) === 1 ) {
243- file . setOverwrite ( true ) ;
244- }
245-
246239 this . _sdlUploadFilePrivate ( file , listener ) ;
247240 }
248241
@@ -252,16 +245,16 @@ class _FileManagerBase extends _SubManagerBase {
252245 * @param {Function } listener - listener called when the upload has finished
253246 */
254247 _sdlUploadFilePrivate ( file , listener ) {
255- const fileName = file . getName ( ) ;
248+ const fileClone = file . clone ( ) ;
249+ const fileName = fileClone . getName ( ) ;
256250
257- const fileWrapper = new _SdlFileWrapper ( file , ( success , bytesAvailable , fileNames , errorMessage ) => {
251+ const fileWrapper = new _SdlFileWrapper ( fileClone , ( success , bytesAvailable , fileNames , errorMessage ) => {
258252 if ( success ) {
259253 this . _bytesAvailable = bytesAvailable ;
260254 this . _remoteFiles . push ( fileName ) ;
261255 if ( ! file . isPersistent ( ) ) {
262256 this . _uploadedEphemeralFileNames . push ( fileName ) ;
263257 }
264- this . _updatePendingOperationsWithNewRemoteFiles ( ) ;
265258 } else if ( errorMessage !== 'File is already on the head unit, aborting upload operation' ) {
266259 this . _incrementFailedUploadCountForFileName ( fileName , this . _failedFileUploadsCount ) ;
267260
@@ -278,7 +271,7 @@ class _FileManagerBase extends _SubManagerBase {
278271 }
279272 } ) ;
280273
281- const operation = new _UploadFileOperation ( this . _lifecycleManager , this , fileWrapper , this . _remoteFiles ) ;
274+ const operation = new _UploadFileOperation ( this . _lifecycleManager , this , fileWrapper ) ;
282275 this . _addTask ( operation ) ;
283276 }
284277
@@ -416,17 +409,6 @@ class _FileManagerBase extends _SubManagerBase {
416409 }
417410 return false ;
418411 }
419-
420- _updatePendingOperationsWithNewRemoteFiles ( ) {
421- for ( const op of this . _getTasks ( ) ) {
422- if ( op . getState ( ) === _Task . IN_PROGRESS || op . getState ( ) === _Task . CANCELED ) {
423- continue ;
424- }
425- if ( op instanceof _UploadFileOperation || op instanceof _DeleteFileOperation ) {
426- op . setRemoteFiles ( this . _remoteFiles ) ;
427- }
428- }
429- }
430412}
431413
432414const SPACE_AVAILABLE_MAX_VALUE = _FileManagerBase . SPACE_AVAILABLE_MAX_VALUE = 2000000000 ;
0 commit comments