View Issue Details

IDProjectCategoryView StatusLast Update
0021687MMW 5Generalpublic2025-07-08 11:36
Reporterzvezdan Assigned To 
PriorityurgentSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Target Version2024.2Fixed in Version2024.2 
Summary0021687: getFolderOfPathAsync resolves with wrong drive/folder
Description1.
Let say that I have database containing only C: and D: in the Medias table. If I specify a root of some non-existent drive, e.g. X:\, I will get the folder object with the idMedia of the last drive from the Medias table and the id/persistentID of the corresponding root folder of that drive from the Folders table. I will get the same result for e.g. X:\jkfhdsfjk (a random string as filename).

If I specify a wrong path with a folder, e.g. X:\rlshjkdfjkdh\ (a random string as folder), I will get 0 for id and persistentID, but idMedia will be as in the previous case.

I expect in such situations getFolderOfPathAsync to reject, or to resolve with undefined, or, at least, not to returns idMedia/persistentID with the incorrect data, but 0.

2.
Let say that I have database containing only C: drive in the Medias table having old serial number, i.e. it is inaccessible (although I have a new C: drive with another serial number). If I use app.filesystem.getFolderOfPathAsync("c:\\"), it will resolve with id and persistentID = 0 and idMedia = -1.

I expect to get the idMedia of the old C: drive and id/persistentID with the corresponding id from the Folders table in database.

As you already know, the object returned by getFolderOfPathAsync() has objectType: "dbfolder", not "folder". I think getFolderFromString() is for that another case (your API is not very informative about it).
Steps To ReproduceYou could try it in Console:
await app.filesystem.getFolderOfPathAsync("x:\\")
TagsNo tags attached.
Fixed in build3163

Activities

Ludek

2025-07-08 11:33

developer   ~0079036

Fixed in 3163
image.png (24,066 bytes)   
image.png (24,066 bytes)   

Ludek

2025-07-08 11:36

developer   ~0079037

2) it will return idMedia of the new existing C:\\ now, and if it doesn't exists yet then it is inserted..
Or if C:\\ is assigned to the old idMedia (via Media Properties) then it will return the old..