Uh oh!
There was an error while loading. Please reload this page.
74642 change isostorage path - #75541
Conversation
ghost
commented
Sep 13, 2022
Tagging subscribers to this area: @dotnet/area-system-io Issue Detailsnull
|
mkhamoyan
commented
Sep 13, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
mkhamoyan
commented
Sep 16, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
mkhamoyan
commented
Sep 16, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| { | ||
| private string GetIsolatedStorageRoot() | ||
| { | ||
| return Helper.GetRootDirectory(Scope); |
There was a problem hiding this comment.
In the mono implementation you linked the code appends .isolated-storage at the very end and I can't see it anywhere in your PR. Is that done somewhere else?
There was a problem hiding this comment.
That is done in https://github.com/dotnet/runtime/blob/main/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.Win32Unix.cs#L26 ,https://github.com/dotnet/runtime/blob/main/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.cs#L8
but thanks for noticing I need to change to previous name as now it will be /IsolatedStorage/
There was a problem hiding this comment.
But the latest change will change the behavior of all platforms, not just the mobile ones, right? I'm not sure if that's something we can/should do, because it could lead to the same problem just on different platforms.
There was a problem hiding this comment.
How does .config get appended to the path on mobile if IsolatedStorageDirectoryName is just .isolated-storage?
There was a problem hiding this comment.
Not in all cases config is appended
( in legacy mono also https://github.com/mono/mono/blob/b40e9939a7d07b30a75625692874f02bcc9be18f/mcs/class/corlib/System/Environment.cs#L623 ). During testing I noticed in some cases there was .config added and I think it was done by GetDataDirectory , it will be included in dataDirectory https://github.com/dotnet/runtime/blob/main/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.Win32Unix.cs#L26
mkhamoyan
commented
Sep 16, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| internal static partial class Helper | ||
| { | ||
| private const string IsolatedStorageDirectoryName = "IsolatedStorage"; | ||
| private const string IsolatedStorageDirectoryName = ".isolated-storage"; |
There was a problem hiding this comment.
Does this change apply to all configurations? If so, we need to make it mobile specific as to not break everyone else.
There was a problem hiding this comment.
It does seem like this file is used by non-mobile platforms as well. I saw that in the original issue discussion, .config/.isolated-storage was mentioned primarily as a workaround to access legacy files (files created when the App was using Xamarin instead of .net 6) to then call System.IO.File.
Is the change IsolatedStorage -> .isolated-storage to address accessing files created by the App when it was running on legacy code?
| /// User: @"C:\Users\jerem\AppData\Local\IsolatedStorage\10v31ho4.bo2\eeolfu22.f2w\" | ||
| /// User|Roaming: @"C:\Users\jerem\AppData\Roaming\IsolatedStorage\" | ||
| /// Machine: @"C:\ProgramData\IsolatedStorage\nin03cyc.wr0\o3j0urs3.0sn\" | ||
| /// User|Roaming: @"C:\Users\jerem\AppData\Roaming\.isolated-storage\" |
There was a problem hiding this comment.
I would provide an iOS and Android example as opposed to windows paths.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| internal static partial class Helper | ||
| { | ||
| private const string IsolatedStorageDirectoryName = "IsolatedStorage"; | ||
| private const string IsolatedStorageDirectoryName = ".isolated-storage"; |
There was a problem hiding this comment.
It does seem like this file is used by non-mobile platforms as well. I saw that in the original issue discussion, .config/.isolated-storage was mentioned primarily as a workaround to access legacy files (files created when the App was using Xamarin instead of .net 6) to then call System.IO.File.
Is the change IsolatedStorage -> .isolated-storage to address accessing files created by the App when it was running on legacy code?
| string path = Helper.GetDataDirectory(scope); | ||
| Assert.Equal("IsolatedStorage", Path.GetFileName(path)); | ||
| Assert.Equal(".isolated-storage", Path.GetFileName(path)); |
There was a problem hiding this comment.
If we are keeping IsolatedStorage on non-mobile platforms, we can have different assert expectations for mobile/non-mobile, or a test to be ran on mobile and a test to be ran on non-mobile
| s_roots.Add(Helper.GetDataDirectory(IsolatedStorageScope.Machine)); | ||
| } | ||
| s_roots = GetRoots(); |
There was a problem hiding this comment.
What tests are failing if this isn't changed?
There was a problem hiding this comment.
As roots are different for mobile and non mobile platforms I needed to implement differently for them.
mkhamoyan
commented
Sep 20, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| internal static partial class Helper | ||
| { | ||
| private const string IsolatedStorageDirectoryName = "IsolatedStorage"; | ||
| public static string IsolatedStorageDirectoryName { get; set;} = "IsolatedStorage"; |
There was a problem hiding this comment.
I think you can have a Helper.AnyMobile.cs and a Helper.NonMobile.cs that has the old string const behavior and you would not need to have an Initialize method.
steveisok
left a comment
There was a problem hiding this comment.
Outside of my one comment, I think it looks good.
mkhamoyan
commented
Sep 26, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
mkhamoyan
commented
Sep 26, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
mdh1418
left a comment
There was a problem hiding this comment.
I'm wondering if we shouldn't just remove the generated hash identity like this (i.e. removing IdentityHash). Thats the Url.j1gfq4nxq1m4zfi31rjvtcuna3umf3fb in the file path of the reported issues' description right? It feels like the identity hash would prevent some sort of collision, but I'm not certain. I'm imagining something like two different applications that just so happen to store their own version of a file file.txt and that the IdentityHash helps distinguish the files so that they wouldn't be unwantedly modified by a different app. If this is the case, then it seems like a bug for iOS that should be fixed (since it was stated that the hash stays the same on Android).
steveisok
commented
Sep 27, 2022
On disk, each app has it's own directory, so I'm not concerned about collisions between different apps. |
steveisok
commented
Sep 27, 2022
/backport to release/7.0 |
Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3137018195 |
JulieLeeMSFT
commented
Sep 28, 2022
@mkhamoyan, I am looking at runtime outerloop failures. Have you checked the test failures in |
steveisok
commented
Sep 28, 2022
This PR doesn't appear to have anything to do with the suites you listed. Are they tvOS failures? If so, can you provide a link to where you are looking? I believe they may be known intermittent issues with devices and not problems with tests. |
The path of a file created by IsolatedStorageFile.GetUserStoreForApplication() changes between Xamarin.iOS and .NET 6, and also changes between different builds of the application under .NET 6.
Switched back to the .isolatedstorage approach we had in legacy mono https://github.com/mono/mono/blob/main/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs#L304-L327
Fix#74642