{"record":{"id":"5771a8753b1e23a1","repo":"xpipe-io/xpipe","slug":"mixed-source-file-systems","errorCode":null,"errorMessage":"Mixed source file systems","messagePattern":"Mixed source file systems","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java","lineNumber":320,"sourceCode":"            var exists = source.getFileSystem().fileExists(source.getPath());\n            if (!exists) {\n                updateProgress(BrowserTransferProgress.finished(source.getName(), 0));\n                return;\n            }\n\n            flatFiles.put(source, FilePath.of(source.getPath().getFileName()));\n            // If we don't have a size, it doesn't matter that much as the total size is only for display\n            totalSize.addAndGet(source.getFileSizeLong().orElse(0));\n        } else {\n            // Unsupported type, e.g. a socket\n            updateProgress(BrowserTransferProgress.finished(source.getName(), 0));\n            return;\n        }\n\n        var originalSourceFs = flatFiles.keySet().iterator().next().getFileSystem();\n        if (!flatFiles.keySet().stream()\n                .allMatch(fileEntry -> fileEntry.getFileSystem().equals(originalSourceFs))) {\n            throw new IllegalArgumentException(\"Mixed source file systems\");\n        }\n\n        var optimizedSourceFs = originalSourceFs.createTransferOptimizedFileSystem();\n        var targetFs = target.getFileSystem().createTransferOptimizedFileSystem();\n\n        try {\n            AtomicLong transferred = new AtomicLong();\n            for (var e : flatFiles.entrySet()) {\n                if (cancelled()) {\n                    return;\n                }\n\n                var sourceFile = e.getKey();\n                var fixedRelPath = targetFs.makeFileSystemCompatible(e.getValue());\n                var targetFile = target.getPath().join(fixedRelPath.toString());\n                if (sourceFile.getFileSystem().equals(targetFs)) {\n                    throw new IllegalStateException();\n                }","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/xpipe-io/xpipe/blob/d85ca821baa46092a320ebb13546d7240adb74f8/app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java#L302-L338","documentation":"Thrown by handleSingleAcrossFileSystems when files selected for a single transfer operation do not all originate from the same file system. The cross-file-system transfer path assumes one source FS and creates a transfer-optimized view for it, so mixed sources are rejected with an IllegalArgumentException.","triggerScenarios":"Selecting files from two different connections/file systems in the browser and performing one consolidated transfer (e.g. dragging items from two systems into one target).","commonSituations":"Multi-select across opened remote connections, dragging from a local browser tab plus a remote tab simultaneously, or scripted transfers that aggregated entries from several systems.","solutions":["Perform one transfer per source file system","Group selections so all files come from a single connection before transferring","Split the batch into separate operations per source system","In code, verify all entries share the same getFileSystem() before invoking"],"exampleFix":"// before\ntransfer(target, List.of(localEntry, remoteEntry))\n// after\ntransfer(target, List.of(localEntry));      // first pass\ntransfer(target, List.of(remoteEntry));     // second pass","handlingStrategy":"validation","validationCode":"function assertSingleSourceFs(files) {\n  const fsSet = new Set(files.map(f => f.fileSystemId));\n  if (fsSet.size > 1) throw new Error('Mixed source file systems: split the transfer');\n}","typeGuard":null,"tryCatchPattern":"try {\n  op.execute(target, files);\n} catch (e) {\n  if (e instanceof RangeError || String(e.message).includes('Mixed source file systems')) {\n    // group entries by file system and transfer per group\n  }\n}","preventionTips":["Never multi-select across different connections for one transfer","Group entries by source file system in scripts","Run one operation per source system"],"tags":["browser","filesystem","transfer"],"backgroundTag":"incompatible-source-type","analyzedSha":"d85ca821baa46092a320ebb13546d7240adb74f8","analyzedAt":"2026-09-06T14:30:08.251Z","contentChangedAt":"2026-09-06T14:30:08.251Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}