Since upgrading to 2019r2 I’ve been having sporadic reports of errors when saving to files in some of my apps. I posted 4 days ago about one where a folderitem that isn’t created yet was treated like a text path.
The real problem is actually much worse than that! Even of the file does exist and any folder in the path changes it’s name then all folderitems referencing anything downstream of that are broken and will result in an error if you try to use it.
In my case I am managing a folder structure inside a bundled document. I change some of the folder names in order to make it easier for the user to know where things are. Even renaming the document folder now breaks every folderitem reference inside that folder. I don’t believe I’m the only one keeping folderitem references around. Previous to 2019r2 a folderitem know what it’s parent folder was even if the parent folder changed it’s name. After 2019r2 changing any folder in the path results in the folderitem become invalid.
Please do this little test and tell me I’m not crazy:
// create the parent folder
Dim f1 As FolderItem = SpecialFolder.Desktop.Child( "starting test folder")
// create a child file and write something to it
Dim f2 As FolderItem = f1.Child( "inside the parent folder")
Dim b As BinaryStream = BinaryStream.Create( f2, True)
// if you stop here everything is good, now rename the parent folder
f1.name = “changed name”
// and attempt to access the f2 folderitem it will cause an io exception
// error happens on next line when running in 2019r2
b = BinaryStream.Create( f2, True)
b.write( "hello again")
I consider this a serious issue as it’s going to break code that has worked fine since the down of Xojo and yet it may not immediately show up in testing. Like me it may not show up until you ship code to users and they start to work with it. Luckily I can take my pre-API2 project back to 2019r1.1 and rebuild it from there in the meantime.
I created a second feedback report to address this specifically:
Feedback Case #58255