Skip to content
This repository was archived by the owner on Feb 27, 2026. It is now read-only.

feat: add fallback mechanism when fs.rename is unsupported#272

Merged
danielalves96 merged 1 commit intokyantech:nextfrom
OpenSrcerer:feat/fuse-rename-support
Oct 2, 2025
Merged

feat: add fallback mechanism when fs.rename is unsupported#272
danielalves96 merged 1 commit intokyantech:nextfrom
OpenSrcerer:feat/fuse-rename-support

Conversation

@OpenSrcerer
Copy link
Copy Markdown
Contributor

📝 Description

FUSE filesystems don't seem to play nice with the fs.rename(..) calls. When I try to upload any file, even if I put both the temp-uploads and uploads dirs to live inside the same FUSE fs, this was the result:

palmr  | Error in filesystem upload: Error: EXDEV: cross-device link not permitted, rename '/app/server/temp-uploads/1759071669706-nhwtia-cmg3q5e3y0000my097faemen9/1759071669672-fGolBOeeC41E.mp3.tmp' -> '/app/server/uploads/cmg3q5e3y0000my097faemen9/1759071669672-fGolBOeeC41E.mp3'
palmr  |     at async Object.rename (node:internal/fs/promises:782:10)
palmr  |     at async FilesystemStorageProvider.uploadFileFromStream (/app/palmr-app/dist/providers/filesystem-storage.provider.js:213:13)
palmr  |     at async FilesystemController.uploadFileStream (/app/palmr-app/dist/modules/filesystem/controller.js:102:9)
palmr  |     at async FilesystemController.upload (/app/palmr-app/dist/modules/filesystem/controller.js:91:13) {
palmr  |   errno: -18,
palmr  |   code: 'EXDEV',
palmr  |   syscall: 'rename',
palmr  |   path: '/app/server/temp-uploads/1759071669706-nhwtia-cmg3q5e3y0000my097faemen9/1759071669672-fGolBOeeC41E.mp3.tmp',
palmr  |   dest: '/app/server/uploads/cmg3q5e3y0000my097faemen9/1759071669672-fGolBOeeC41E.mp3'
palmr  | }

So, I've added a wrapper that reverts back to fs.copy(..) + fs.unlink(..) when such an error is detected.

🔗 Related Issue(s)

Haven't opened one, but can open if you need to log it.

💡 Motivation and Context

I don't have plenty of storage on my device, but I do have plenty in the cloud. Thus, taking inspiration from network drives, I mounted a Google Drive folder to use as my storage medium for Palmr, which is what I was using to reproduce the issue. I believe that this is a clean way to implement storage.

🤖 Use of Artificial Intelligence (AI)

The use of AI tools is absolutely welcome and not an issue. For transparency and continuous improvement, please answer the following:

  • Did you use any AI tools (such as GitHub Copilot, ChatGPT, etc.) to help develop this PR?
    • No, this PR was developed without the assistance of AI tools.
    • Yes, AI tools assisted in the development of this PR (please specify which ones and how they were used):
      • Tool(s) used:
      • Brief description of how AI contributed:
  • Was this PR generated entirely by an AI tool (i.e., with minimal human intervention)?
    • No
    • Yes (please provide details):

🧪 How Has This Been Tested?

I've built the application through Docker with these changes applied and verified that even on the network drive, I was able to use Palmr properly.

📸 Screenshots (if appropriate)

Add any relevant screenshots to help explain your changes.

🔄 Types of Changes

Check the relevant option(s) below:

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 📚 Documentation update

✅ Checklist

  • My code follows the code style of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have rebased and/or merged on top of the latest next branch

🙏 Thank you for your contribution!

@danielalves96 danielalves96 merged commit 6086d2a into kyantech:next Oct 2, 2025
anthony0030 pushed a commit to anthony0030/Palmr that referenced this pull request Jan 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants