Inconsistency between folders nativePath

Just wasted ~6 hours just on this and had to restart my PC 2 times…

Simplified example:

const temp = (await storage.localFileSystem.getTemporaryFolder()).nativePath
const data = (await storage.localFileSystem.getDataFolder()).nativePath
const plugin = (await storage.localFileSystem.getPluginFolder()).nativePath

console.log(temp) // C:\users\...\temp\...\PluginData
console.log(data) // C:\users\...\Roaming\...\PluginData
console.log(plugin) // C:\path\to\plugin\

Notice the trailing backslash on the plugin result
Then trying to get fs.lstatSync(plugin) completely froze Photoshop and couldn’t even kill the process. Took some restarts at the end of debugging to finally pin-point the problem

Don’t know if it’s just Windows issue or MacOS also, but that’s not how APIs should behave :confounded:

Posting here if someone runs into this…

Is async function with a same issue?

These are all 3 async functions (see await :slightly_smiling_face:). I’m not aware of synchronous ones

I mean this one. It has async version. So I was thinking if fs.lstatSync causes freezing is it same case for fs.lstat ?

Oh, that. I actually don’t know - didn’t try after figuring out the slash. Might try some time if I remember when I get back to that part of code