View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0021687 | MMW 5 | General | public | 2025-07-07 19:58 | 2025-07-08 18:29 |
Reporter | zvezdan | Assigned To | |||
Priority | urgent | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Target Version | 2024.2 | Fixed in Version | 2024.2 | ||
Summary | 0021687: getFolderOfPathAsync resolves with wrong drive/folder | ||||
Description | 1. 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 Reproduce | You could try it in Console: await app.filesystem.getFolderOfPathAsync("x:\\") | ||||
Tags | No tags attached. | ||||
Fixed in build | 3163 | ||||
|
Fixed in 3163 |
|
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.. |
|
> if it doesn't exists yet then it is inserted.. I am not sure that understand. Do you want to say that calling the mentioned function could add a new record into the Medias table? I think that would be quite unacceptable and there is no any reason for doing that. That function should return dbFolder object and nothing more. |
|
It adds new record just for the existing drives, if the drive doesn't exist then it returns 'folder not found' |
|
What is the reason for adding a new record to the Medias table? This function should not alter the database at all. If I didn't report this problem, you wouldn't even think about doing that. |