Skip to content

Feat/add option to change virtual drive path#345

Draft
egalvis27 wants to merge 43 commits into
mainfrom
feat/add-option-to-change-virtual-drive-path
Draft

Feat/add option to change virtual drive path#345
egalvis27 wants to merge 43 commits into
mainfrom
feat/add-option-to-change-virtual-drive-path

Conversation

@egalvis27
Copy link
Copy Markdown

What is Changed / Added

Virtual Drive Root Path Selection

This PR introduces the ability for users to choose where the Internxt virtual drive is mounted on their system.

How it works

The user selects a base directory (e.g. ~/Downloads). The app always creates a fixed subfolder called Internxt Drive inside it, so the final mount point is always <base>/Internxt Drive/. This separation ensures the FUSE filesystem is isolated and never conflicts with the user's own files in the chosen folder.

The selected base path is persisted in the config store under virtualDriveRoot. The legacy syncRoot key is kept in sync for backwards compatibility with older code paths that still read it.

Remount lifecycle

Changing the root path triggers a full remount cycle orchestrated by remountVirtualDriveOnRootChange:

  1. Stop — The running FUSE daemon receives SIGTERM. The Go process calls server.Unmount() to detach the filesystem from the kernel. If that fails (e.g. the file manager has the folder open), the daemon still exits.

  2. Stale mount cleanup — Before deleting the old directory, fusermount3 -uz <oldPath> is issued as a lazy unmount. This forces the kernel to release the mount entry even if the daemon exited without cleanly unmounting, preventing ENOTCONN errors on subsequent filesystem operations.

  3. Old directory removal — The previous Internxt Drive folder is deleted. Several safety guards prevent accidental deletion: the path must be non-empty, must not resolve to /, and must not resolve to the user's home directory.

  4. Start — A new FUSE daemon is spawned with the updated INTERNXT_MOUNT environment variable pointing to the new path. The folder is created automatically if it does not exist.

Boot ID correlation

Each daemon spawn generates a random bootId (UUID). It is passed to the Go process via INTERNXT_BOOT_ID and echoed back in the POST /daemon/ready HTTP payload. The Node.js side validates that the received boot ID matches the active one before resolving the startup promise. This prevents a stale ready signal from a slow-exiting previous daemon from being mistaken for the new daemon being ready.

Concurrency guards

Both stopVirtualDriveOnce and remountVirtualDriveOnRootChange deduplicate concurrent calls via an in-flight promise. If a remount is already in progress when a second call arrives (e.g. the user clicks "Change" twice), the second caller awaits the same promise rather than starting a parallel remount. The in-flight reference is cleared in a finally block so subsequent calls can proceed normally after completion or failure.

AlexisMora and others added 30 commits April 15, 2026 14:15
* feat: Get Attributes operation + Electron 21

* fix: node: http
* feat: golang lint

* feat: golang test pipeline

* chore: go daemon testing

* chore: testing for virtual drive module

* fix: go lint workflow

* fix: go lint workflow bump version

* chore: lint issues in golang

* fix: pr comments

* fix: format
* feat: Implement Open and OpenDir FUSE opeartions

* fix:format

* fix: linting warnings

* fix: simplification of fuse status transport betweeen daemon and electron

* chore:tests

* fix:format

* chore: skip unused fuseApp class test + fix test

* Fix lint warning
…or native modules (#331)

* Feat: upgrade electron to version 25 and enforce source compilation for native modules

* Feat: import app from electron and ensure app quits on auth window close if not logged in

* Feat: enhance tray menu initialization and context menu handling

* Feat: refine context menu handling for Linux tray interactions

* fix: tray menu test

---------

Co-authored-by: AlexisMora <alexis@internxt.com>
…#290)

* Feat: download a file range of bytes

* WIP: download files on demand

* fix:format

* fix merge issues

* feat: update eslint, update props from handleReadCallback, clearhydrationState before mounting fuse

* chore: change legacy fuseApp code so ts does not complain

* feat: allow ranged requests

* fix:format

* fix: delete orphaned files

* fix: tests + removed unused code
* feat: update drive destkop linux to electron 29 and node 20

* fix: add js script to import main.ts because output code is commonjs
@sonarqubecloud
Copy link
Copy Markdown

Base automatically changed from feat/go-fuse-daemon to main June 1, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants