Repository navigation
Conversation
added 6 commits
June 29, 2026 13:09
When a document is opened from a UNC path (e.g. \server\share\... or \wsl.localhost\Distro\...), getImageSrc() and resolveLocalImageSrc() produced invalid file:// URLs with 4 slashes (file:////server/share/...) that Chromium cannot load, causing 'Load image failed' errors. Root cause: both muya's path resolver and the desktop's export/print resolver prepend 'file://' to UNC paths, producing the malformed URL 'file:////server/share/...' instead of the correct authority-based form 'file://server/share/...'. Fix: add a pathToFileUrl() helper that detects UNC paths (starting with // after backslash normalisation) and produces the correct authority form. Applied consistently in: - packages/muya/src/utils/image.ts: getImageSrc() and correctImageSrc() - packages/desktop/src/renderer/src/util/resolveImageSrc.ts Fixes marktext#4577, marktext#4563 (use case 1)
- Add pathToFileUrl helper for correct file:// URL normalization - Switch to template literals (prefer-template lint) - Add readdir-based polling fallback for FUSE/SSHFS watcher - Update test expectations for normalized file:// URLs
jyte
marked this pull request as draft
June 29, 2026 15:53
jyte
force-pushed
the
fix/project-over-network-fs
branch
from
June 30, 2026 06:21
446f6d1 to
144b416
Compare
ced is a native module compiled for Electron's Node.js ABI. When vitest runs under the system Node.js (CI), binding resolution hangs for >5s, causing the dynamic import of watcher.ts to time out. Mock ced so the import succeeds instantly and the 8 watcher tests pass.
jyte
marked this pull request as ready for review
June 30, 2026 06:43
3 of 6 tasks
niyo-oyin
added a commit
to niyo-oyin/marktext-ja
that referenced
this pull request
Jul 30, 2026
chokidar's native watchers never fire on UNC shares, WSL mounts and SSHFS, so externally-edited files silently stayed stale. Fall back to a 3s polling scan for those paths, and route the polled events through the same self-write suppression the native watcher uses so saving from MarkText itself does not raise a bogus "file changed on disk" prompt.
2 of 6 tasks
This was referenced Sep 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based of PR 4788
Closes #4599 #4477 #4563 (usecase 1 & 2)
Summary
Fix file watching and image URL resolution on Windows network shares (UNC paths),
WSL, SSHFS, and other FUSE-based filesystem mounts where native file watching is
not supported and
file://URLs were malformed.Type of change
Test plan
Notes for reviewers [optional]
chokidar /
fs.watchcannot watch Windows UNC paths or virtual filesystemssuch as WSL2's 9P protocol, SSHFS mounts, network drives, and Docker-mounted
volumes because they do not support
ReadDirectoryChangesWorinotify.Fix: When
fs.realpathSync.native()fails (indicating a non-nativefilesystem), the watcher falls back to a manual
readdir-based poll loop(interval: 3s) instead of crashing or silently missing changes.
This is not ideal, but at least it works.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.