diff --git a/explore/2020-02-02.memory-leak/demo-memory-leak/TestSetup.cs b/explore/2020-02-02.memory-leak/demo-memory-leak/TestSetup.cs index 3ce79e98..d6e5a946 100644 --- a/explore/2020-02-02.memory-leak/demo-memory-leak/TestSetup.cs +++ b/explore/2020-02-02.memory-leak/demo-memory-leak/TestSetup.cs @@ -8,6 +8,7 @@ public class TestSetup static public IReadOnlyCollection<(string filePath, byte[] fileContent)> GetElmAppFromFilePath( string filePath) => ElmApp.FilesFilteredForElmApp(Filesystem.GetAllFilesFromDirectory(filePath)) + .OrderBy(file => file.filePath) .ToImmutableList(); } } diff --git a/implement/PersistentProcess/PersistentProcess.Common/Composition.cs b/implement/PersistentProcess/PersistentProcess.Common/Composition.cs index 28636adb..fbdaacee 100644 --- a/implement/PersistentProcess/PersistentProcess.Common/Composition.cs +++ b/implement/PersistentProcess/PersistentProcess.Common/Composition.cs @@ -200,9 +200,9 @@ static public Component FromTree(TreeComponent tree) }; } - static public TreeComponent TreeFromSetOfBlobsWithCommonFilePath( + static public TreeComponent SortedTreeFromSetOfBlobsWithCommonFilePath( IEnumerable<(string path, IImmutableList blobContent)> blobsWithPath) => - TreeFromSetOfBlobs( + SortedTreeFromSetOfBlobs( blobsWithPath.Select(blobWithPath => { var pathComponents = @@ -214,75 +214,74 @@ static public TreeComponent TreeFromSetOfBlobsWithCommonFilePath( }) ); - static public TreeComponent TreeFromSetOfBlobsWithCommonFilePath( + static public TreeComponent SortedTreeFromSetOfBlobsWithCommonFilePath( IEnumerable<(string path, byte[] blobContent)> blobsWithPath) => - TreeFromSetOfBlobsWithCommonFilePath( + SortedTreeFromSetOfBlobsWithCommonFilePath( blobsWithPath.Select(blobWithPath => (blobWithPath.path, (IImmutableList)blobWithPath.blobContent.ToImmutableList()))); - static public TreeComponent TreeFromSetOfBlobs( + static public TreeComponent SortedTreeFromSetOfBlobs( IEnumerable<(IImmutableList path, IImmutableList blobContent)> blobsWithPath, Func> mapPathComponent) => - TreeFromSetOfBlobs( + SortedTreeFromSetOfBlobs( blobsWithPath.Select(blobWithPath => (path: (IImmutableList>)blobWithPath.path.Select(mapPathComponent).ToImmutableList(), blobContent: blobWithPath.blobContent))); - static public TreeComponent TreeFromSetOfBlobsWithStringPath( + static public TreeComponent SortedTreeFromSetOfBlobsWithStringPath( IEnumerable<(IImmutableList path, IImmutableList blobContent)> blobsWithPath) => - TreeFromSetOfBlobs( + SortedTreeFromSetOfBlobs( blobsWithPath, pathComponent => System.Text.Encoding.UTF8.GetBytes(pathComponent).ToImmutableList()); - static public TreeComponent TreeFromSetOfBlobsWithStringPath( + static public TreeComponent SortedTreeFromSetOfBlobsWithStringPath( IReadOnlyDictionary, IImmutableList> blobsWithPath) => - TreeFromSetOfBlobsWithStringPath( + SortedTreeFromSetOfBlobsWithStringPath( blobsWithPath.Select(pathAndBlobContent => (path: pathAndBlobContent.Key, blobContent: pathAndBlobContent.Value))); - static public TreeComponent TreeFromSetOfBlobs( + static public TreeComponent SortedTreeFromSetOfBlobs( IEnumerable<(IImmutableList> path, IImmutableList blobContent)> blobsWithPath) => new TreeComponent { - TreeContent = TreeContentFromSetOfBlobs(blobsWithPath) + TreeContent = SortedTreeContentFromSetOfBlobs(blobsWithPath) }; - static public IImmutableList<(IImmutableList name, TreeComponent obj)> TreeContentFromSetOfBlobs( - IEnumerable<(IImmutableList> path, IImmutableList blobContent)> blobsWithPath) + static public IImmutableList<(IImmutableList name, TreeComponent obj)> SortedTreeContentFromSetOfBlobs( + IEnumerable<(IImmutableList> path, IImmutableList blobContent)> blobsWithPath) => + blobsWithPath + .Aggregate( + (IImmutableList<(IImmutableList name, TreeComponent obj)>) + ImmutableList<(IImmutableList name, TreeComponent obj)>.Empty, + (intermediateResult, nextBlob) => SetBlobAtPathSorted(intermediateResult, nextBlob.path, nextBlob.blobContent)); + + static public IImmutableList<(IImmutableList name, TreeComponent obj)> SetBlobAtPathSorted( + IImmutableList<(IImmutableList name, TreeComponent obj)> treeContentBefore, + IImmutableList> path, + IImmutableList blobContent) { - var groupedByDirectory = - blobsWithPath - .GroupBy( - pathAndContent => 1 < pathAndContent.path.Count ? pathAndContent.path.First() : null, - new ByteListComparer()) - .ToImmutableList(); + var pathFirstElement = path.First(); - var currentLevelBlobs = - groupedByDirectory - .FirstOrDefault(group => group.Key == null) - .EmptyIfNull() - .Select(pathAndContent => - (name: pathAndContent.path.First(), - blobContent: new TreeComponent { BlobContent = pathAndContent.blobContent.ToImmutableList() })) - .OrderBy(nameAndContent => nameAndContent.name, new ByteListComparer()) - .ToImmutableList(); + var componentBefore = + treeContentBefore.FirstOrDefault(c => c.name.SequenceEqual(pathFirstElement)).obj; - var subTrees = - groupedByDirectory - .Where(group => group.Key != null) - .Select(directoryGroup => + var component = + path.Count < 2 + ? + new TreeComponent { BlobContent = blobContent } + : + new TreeComponent { - var blobsWithRelativePaths = - directoryGroup.Select(pathAndContent => - (path: (IImmutableList>)pathAndContent.path.Skip(1).ToImmutableList(), - blobContent: pathAndContent.blobContent)); + TreeContent = + SetBlobAtPathSorted( + componentBefore?.TreeContent ?? ImmutableList<(IImmutableList name, TreeComponent obj)>.Empty, + path.RemoveAt(0), + blobContent) + }; - return (name: (IImmutableList)directoryGroup.Key.ToImmutableList(), content: new TreeComponent - { - TreeContent = TreeContentFromSetOfBlobs(blobsWithRelativePaths) - }); - }) - .OrderBy(nameAndContent => nameAndContent.name, new ByteListComparer()) + return + treeContentBefore + .RemoveAll(c => ByteListComparer.CompareStatic(c.name, pathFirstElement) == 0) + .Add((pathFirstElement, component)) + .OrderBy(c => c.name, new ByteListComparer()) .ToImmutableList(); - - return currentLevelBlobs.AddRange(subTrees).ToImmutableList(); } static public Result Deserialize( @@ -456,7 +455,10 @@ public class ParseAsTreeResult : Result>, IEqualityComparer> { - public int Compare(IReadOnlyList x, IReadOnlyList y) + public int Compare(IReadOnlyList x, IReadOnlyList y) => + CompareStatic(x, y); + + static public int CompareStatic(IReadOnlyList x, IReadOnlyList y) { if (x == null && y == null) return 0; diff --git a/implement/PersistentProcess/PersistentProcess.Common/ElmApp.cs b/implement/PersistentProcess/PersistentProcess.Common/ElmApp.cs index 944a8f01..7a39d04c 100644 --- a/implement/PersistentProcess/PersistentProcess.Common/ElmApp.cs +++ b/implement/PersistentProcess/PersistentProcess.Common/ElmApp.cs @@ -52,9 +52,11 @@ static public bool FilePathMatchesPatternOfFilesInElmApp(string filePath) => .Where(file => 0 < file.filePath?.Length && FilePathMatchesPatternOfFilesInElmApp(file.filePath)); static public IImmutableDictionary, IImmutableList> ToFlatDictionaryWithPathComparer( - IEnumerable<(IImmutableList filePath, IImmutableList fileContent)> fileList) => - fileList.ToImmutableDictionary(entry => entry.filePath, entry => entry.fileContent) - .WithComparers(EnumerableExtension.EqualityComparer()); + IEnumerable<(IImmutableList filePath, IImmutableList fileContent)> filesBeforeSorting) => + filesBeforeSorting.ToImmutableSortedDictionary( + entry => entry.filePath, + entry => entry.fileContent, + EnumerableExtension.Comparer>()); static public IImmutableDictionary, IImmutableList> AsCompletelyLoweredElmApp( IImmutableDictionary, IImmutableList> sourceFiles, diff --git a/implement/PersistentProcess/PersistentProcess.Common/EnumerableExtension.cs b/implement/PersistentProcess/PersistentProcess.Common/EnumerableExtension.cs index ba0f4f53..ad5e59bc 100644 --- a/implement/PersistentProcess/PersistentProcess.Common/EnumerableExtension.cs +++ b/implement/PersistentProcess/PersistentProcess.Common/EnumerableExtension.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; namespace Kalmit @@ -15,7 +16,9 @@ static public IEnumerable WhereNotNull(this IEnumerable orig) where T : static public IEnumerable EmptyIfNull(this IEnumerable orig) => orig ?? Array.Empty(); - static public IEqualityComparer> EqualityComparer() => new IEnumerableComparer(); + static public IEqualityComparer> EqualityComparer() => new IEnumerableEqualityComparer(); + + static public IComparer Comparer() where T : IEnumerable => new IEnumerableComparer(); // From https://github.com/morelinq/MoreLINQ/blob/07bd0861658b381ce97c8b44d3b9f2cd3c9bf769/MoreLinq/TakeUntil.cs static public IEnumerable TakeUntil(this IEnumerable source, Func predicate) @@ -34,7 +37,7 @@ static public IEnumerable TakeUntil(this IEnumerable } } - class IEnumerableComparer : IEqualityComparer> + class IEnumerableEqualityComparer : IEqualityComparer> { public bool Equals(IEnumerable x, IEnumerable y) { @@ -43,5 +46,48 @@ public bool Equals(IEnumerable x, IEnumerable y) public int GetHashCode(IEnumerable obj) => 0; } + + class IEnumerableComparer : IComparer where T : IEnumerable + { + public int Compare([AllowNull] IEnumerable x, [AllowNull] IEnumerable y) + { + if (x == y) + return 0; + + if (x == null) + return -1; + + if (y == null) + return 1; + + var xEnumerator = x.GetEnumerator(); + var yEnumerator = y.GetEnumerator(); + + while (true) + { + var xHasCurrent = xEnumerator.MoveNext(); + var yHasCurrent = yEnumerator.MoveNext(); + + if (!xHasCurrent && !yHasCurrent) + return 0; + + if (!xHasCurrent) + return -1; + + if (!yHasCurrent) + return 1; + + var currentComparison = xEnumerator.Current.CompareTo(yEnumerator.Current); + + if (currentComparison != 0) + return currentComparison; + } + } + + public int Compare([AllowNull] T x, [AllowNull] T y) + { + return Compare((IEnumerable)x, (IEnumerable)y); + } + } } } \ No newline at end of file diff --git a/implement/PersistentProcess/PersistentProcess.Common/LoadFromLocalFilesystem.cs b/implement/PersistentProcess/PersistentProcess.Common/LoadFromLocalFilesystem.cs index 6d1e8712..0a0212cd 100644 --- a/implement/PersistentProcess/PersistentProcess.Common/LoadFromLocalFilesystem.cs +++ b/implement/PersistentProcess/PersistentProcess.Common/LoadFromLocalFilesystem.cs @@ -1,13 +1,12 @@ using System.Collections.Immutable; using System.IO; using System.Linq; -using System.Text; namespace Kalmit { static public class LoadFromLocalFilesystem { - static public Composition.TreeComponent LoadTreeFromPath(string path) + static public Composition.TreeComponent LoadSortedTreeFromPath(string path) { if (File.Exists(path)) return new Composition.TreeComponent { BlobContent = File.ReadAllBytes(path).ToImmutableList() }; @@ -15,20 +14,13 @@ static public Composition.TreeComponent LoadTreeFromPath(string path) if (!Directory.Exists(path)) return null; - var treeEntries = - Directory.EnumerateFileSystemEntries(path) - .Select(fileSystemEntry => - { - var name = (IImmutableList)Encoding.UTF8.GetBytes(Path.GetRelativePath(path, fileSystemEntry)).ToImmutableList(); - - return (name, LoadTreeFromPath(fileSystemEntry)); - }) + var blobs = + Filesystem.GetAllFilesFromDirectory(path) + .Select(file => (path: (System.Collections.Immutable.IImmutableList)file.name.Split('/', '\\').ToImmutableList(), content: file.content)) .ToImmutableList(); - return new Composition.TreeComponent - { - TreeContent = treeEntries, - }; + return + Composition.SortedTreeFromSetOfBlobsWithStringPath(blobs); } } } diff --git a/implement/PersistentProcess/PersistentProcess.Common/LoadFromPath.cs b/implement/PersistentProcess/PersistentProcess.Common/LoadFromPath.cs index e9ec5aeb..cb3c2d0c 100644 --- a/implement/PersistentProcess/PersistentProcess.Common/LoadFromPath.cs +++ b/implement/PersistentProcess/PersistentProcess.Common/LoadFromPath.cs @@ -23,7 +23,7 @@ static public class LoadFromPath else { return Result.ok( - (tree: LoadFromLocalFilesystem.LoadTreeFromPath(path), comesFromLocalFilesystem: true)); + (tree: LoadFromLocalFilesystem.LoadSortedTreeFromPath(path), comesFromLocalFilesystem: true)); } } } diff --git a/implement/PersistentProcess/PersistentProcess.Common/ZipArchive.cs b/implement/PersistentProcess/PersistentProcess.Common/ZipArchive.cs index 63c48d9f..432c5193 100644 --- a/implement/PersistentProcess/PersistentProcess.Common/ZipArchive.cs +++ b/implement/PersistentProcess/PersistentProcess.Common/ZipArchive.cs @@ -6,6 +6,9 @@ namespace Kalmit { + /* + 2020-07-16 Discovered: The roundtrip over `ZipArchiveFromEntries` and `EntriesFromZipArchive` changed the order of entries! + */ static public class ZipArchive { /// diff --git a/implement/PersistentProcess/PersistentProcess.Test/Common.cs b/implement/PersistentProcess/PersistentProcess.Test/Common.cs index cbb5cdd4..a0ef61a9 100644 --- a/implement/PersistentProcess/PersistentProcess.Test/Common.cs +++ b/implement/PersistentProcess/PersistentProcess.Test/Common.cs @@ -76,6 +76,7 @@ static public IImmutableDictionary, IImmutableList> ElmApp.ToFlatDictionaryWithPathComparer( ElmApp.FilesFilteredForElmApp( Filesystem.GetAllFilesFromDirectory(Path.Combine(PathToExampleElmApps, exampleName))) + .OrderBy(file => file.filePath) .Select(filePathAndContent => ((IImmutableList)filePathAndContent.filePath.Split(new[] { '/', '\\' }).ToImmutableList(), filePathAndContent.fileContent))); static public IImmutableDictionary, IImmutableList> AsLoweredElmApp( diff --git a/implement/PersistentProcess/PersistentProcess.Test/TestComposition.cs b/implement/PersistentProcess/PersistentProcess.Test/TestComposition.cs index 6d37b491..fd57a300 100644 --- a/implement/PersistentProcess/PersistentProcess.Test/TestComposition.cs +++ b/implement/PersistentProcess/PersistentProcess.Test/TestComposition.cs @@ -172,7 +172,7 @@ public void Composition_from_file_tree() foreach (var testCase in testCases) { var asComposition = Composition.FromTree( - Composition.TreeFromSetOfBlobsWithCommonFilePath(testCase.input)); + Composition.SortedTreeFromSetOfBlobsWithCommonFilePath(testCase.input)); Assert.AreEqual(testCase.expectedOutput, asComposition); } diff --git a/implement/PersistentProcess/PersistentProcess.Test/TestElmEvaluation.cs b/implement/PersistentProcess/PersistentProcess.Test/TestElmEvaluation.cs index 51ad8ef9..74ebc4d4 100644 --- a/implement/PersistentProcess/PersistentProcess.Test/TestElmEvaluation.cs +++ b/implement/PersistentProcess/PersistentProcess.Test/TestElmEvaluation.cs @@ -21,7 +21,7 @@ public void TestElmEvaluationScenarios() try { - var appCodeTree = LoadFromLocalFilesystem.LoadTreeFromPath(Path.Combine(scenarioDirectory, "app-code")); + var appCodeTree = LoadFromLocalFilesystem.LoadSortedTreeFromPath(Path.Combine(scenarioDirectory, "app-code")); var expectedValueFile = File.ReadAllBytes(Path.Combine(scenarioDirectory, "expected-value.json")); diff --git a/implement/PersistentProcess/PersistentProcess.Test/TestElmWebAppHttpServer.cs b/implement/PersistentProcess/PersistentProcess.Test/TestElmWebAppHttpServer.cs index d664156b..e1a39ae3 100644 --- a/implement/PersistentProcess/PersistentProcess.Test/TestElmWebAppHttpServer.cs +++ b/implement/PersistentProcess/PersistentProcess.Test/TestElmWebAppHttpServer.cs @@ -10,7 +10,7 @@ public class TestElmWebAppHttpServer { static public Composition.Component AppConfigComponentFromFiles( IImmutableDictionary, IImmutableList> appFiles) => - Composition.FromTree(Composition.TreeFromSetOfBlobsWithStringPath(appFiles)); + Composition.FromTree(Composition.SortedTreeFromSetOfBlobsWithStringPath(appFiles)); static public Composition.Component CounterWebApp => AppConfigComponentFromFiles(TestSetup.CounterElmWebApp); diff --git a/implement/PersistentProcess/PersistentProcess.Test/TestModeledInElm.cs b/implement/PersistentProcess/PersistentProcess.Test/TestModeledInElm.cs index 66b0df37..f4d25531 100644 --- a/implement/PersistentProcess/PersistentProcess.Test/TestModeledInElm.cs +++ b/implement/PersistentProcess/PersistentProcess.Test/TestModeledInElm.cs @@ -23,6 +23,7 @@ static IImmutableDictionary, IImmutableList> GetLow ElmApp.ToFlatDictionaryWithPathComparer( ElmApp.FilesFilteredForElmApp( Filesystem.GetAllFilesFromDirectory(FilePathStringFromPath(directoryPath))) + .OrderBy(file => file.filePath) .Select(filePathAndContent => ((IImmutableList)filePathAndContent.filePath.Split(new[] { '/', '\\' }).ToImmutableList(), filePathAndContent.fileContent))); return diff --git a/implement/PersistentProcess/PersistentProcess.Test/TestWebHost.cs b/implement/PersistentProcess/PersistentProcess.Test/TestWebHost.cs index 2aa35cf9..7c5de117 100644 --- a/implement/PersistentProcess/PersistentProcess.Test/TestWebHost.cs +++ b/implement/PersistentProcess/PersistentProcess.Test/TestWebHost.cs @@ -112,7 +112,7 @@ public void Web_host_serves_static_content_from_source_file() defaultAppSourceFiles.SetItem(demoSourceFilePath, staticContent); var webAppSource = - Composition.FromTree(Composition.TreeFromSetOfBlobsWithStringPath(webAppSourceFiles)); + Composition.FromTree(Composition.SortedTreeFromSetOfBlobsWithStringPath(webAppSourceFiles)); using (var testSetup = WebHostAdminInterfaceTestSetup.Setup(deployAppConfigAndInitElmState: webAppSource)) { @@ -163,7 +163,7 @@ void letTimePassInPersistentProcessHost(TimeSpan amount) => }); using (var testSetup = WebHostAdminInterfaceTestSetup.Setup( - deployAppConfigAndInitElmState: Composition.FromTree(Composition.TreeFromSetOfBlobsWithStringPath(webAppConfig)), + deployAppConfigAndInitElmState: Composition.FromTree(Composition.SortedTreeFromSetOfBlobsWithStringPath(webAppConfig)), persistentProcessHostDateTime: () => persistentProcessHostDateTime)) { IEnumerable EnumerateStoredProcessEventsHttpRequestsBodies() => @@ -569,7 +569,7 @@ public void Web_host_supports_deploy_app_config_and_init_elm_app_state() var webAppConfigZipArchive = ZipArchive.ZipArchiveFromEntries(TestSetup.CounterElmWebApp); var webAppConfigTree = - Composition.TreeFromSetOfBlobsWithCommonFilePath( + Composition.SortedTreeFromSetOfBlobsWithCommonFilePath( ZipArchive.EntriesFromZipArchive(webAppConfigZipArchive).ToImmutableList()); using (var testSetup = WebHostAdminInterfaceTestSetup.Setup()) @@ -592,7 +592,7 @@ public void Web_host_supports_deploy_app_config_and_init_elm_app_state() var getAppResponseContent = getAppConfigResponse.Content.ReadAsByteArrayAsync().Result; var responseAppConfigTree = - Composition.TreeFromSetOfBlobsWithCommonFilePath( + Composition.SortedTreeFromSetOfBlobsWithCommonFilePath( ZipArchive.EntriesFromZipArchive(getAppResponseContent).ToImmutableList()); CollectionAssert.AreEqual( diff --git a/implement/PersistentProcess/PersistentProcess.WebHost/Program.cs b/implement/PersistentProcess/PersistentProcess.WebHost/Program.cs index 06fcc18c..a6ceb8f2 100644 --- a/implement/PersistentProcess/PersistentProcess.WebHost/Program.cs +++ b/implement/PersistentProcess/PersistentProcess.WebHost/Program.cs @@ -2,6 +2,6 @@ namespace Kalmit.PersistentProcess.WebHost { public class Program { - static public string AppVersionId => "2020-07-11"; + static public string AppVersionId => "2020-07-16"; } } diff --git a/implement/PersistentProcess/PersistentProcess.WebHost/StartupAdminInterface.cs b/implement/PersistentProcess/PersistentProcess.WebHost/StartupAdminInterface.cs index 05db177c..243c5ad1 100644 --- a/implement/PersistentProcess/PersistentProcess.WebHost/StartupAdminInterface.cs +++ b/implement/PersistentProcess/PersistentProcess.WebHost/StartupAdminInterface.cs @@ -375,7 +375,7 @@ IWebHost buildWebHost() } var appConfigTree = - Composition.TreeFromSetOfBlobsWithCommonFilePath( + Composition.SortedTreeFromSetOfBlobsWithCommonFilePath( ZipArchive.EntriesFromZipArchive(webAppConfigZipArchive)); var appConfigComponent = Composition.FromTree(appConfigTree); diff --git a/implement/elm-fullstack/Program.cs b/implement/elm-fullstack/Program.cs index cfbc1811..db8369f3 100644 --- a/implement/elm-fullstack/Program.cs +++ b/implement/elm-fullstack/Program.cs @@ -146,7 +146,7 @@ static int Main(string[] args) sourcePath: deployAppFromOption.Value()).configZipArchive; var appConfigTree = - Composition.TreeFromSetOfBlobsWithCommonFilePath( + Composition.SortedTreeFromSetOfBlobsWithCommonFilePath( ZipArchive.EntriesFromZipArchive(appConfigZipArchive)); var appConfigComponent = Composition.FromTree(appConfigTree); @@ -407,7 +407,7 @@ static int Main(string[] args) compilationLog.Add); compiledTree = - Composition.TreeFromSetOfBlobsWithStringPath(loweredAppFiles); + Composition.SortedTreeFromSetOfBlobsWithStringPath(loweredAppFiles); } catch (Exception e) { @@ -611,7 +611,7 @@ static public DeployAppReport deployApp( var filteredSourceCompositionId = Kalmit.CommonConversion.StringBase16FromByteArray( - Composition.GetHash(Composition.FromTree(Composition.TreeFromSetOfBlobsWithCommonFilePath( + Composition.GetHash(Composition.FromTree(Composition.SortedTreeFromSetOfBlobsWithCommonFilePath( Kalmit.ZipArchive.EntriesFromZipArchive(appConfigZipArchive))))); Console.WriteLine( @@ -682,7 +682,7 @@ static public DeployAppReport deployApp( processStoreFileStore); var appConfigTree = - Composition.TreeFromSetOfBlobsWithCommonFilePath( + Composition.SortedTreeFromSetOfBlobsWithCommonFilePath( ZipArchive.EntriesFromZipArchive(appConfigZipArchive)); var appConfigComponent = Composition.FromTree(appConfigTree); @@ -995,7 +995,7 @@ static IImmutableDictionary, IImmutableList> LoadFi return ElmApp.ToFlatDictionaryWithPathComparer( - Composition.TreeFromSetOfBlobsWithCommonFilePath(zipArchiveEntries) + Composition.SortedTreeFromSetOfBlobsWithCommonFilePath(zipArchiveEntries) .EnumerateBlobsTransitive() .Select(blobPathAndContent => ( fileName: (IImmutableList)blobPathAndContent.path.Select(name => System.Text.Encoding.UTF8.GetString(name.ToArray())).ToImmutableList(), @@ -1012,7 +1012,7 @@ static public void replicateProcessAndLogToConsole( LoadFilesForRestoreFromPathAndLogToConsole(sourcePath: sourcePath, sourcePassword: sourcePassword); var processHistoryTree = - Composition.TreeFromSetOfBlobsWithStringPath(restoreFiles); + Composition.SortedTreeFromSetOfBlobsWithStringPath(restoreFiles); var processHistoryComponentHash = Composition.GetHash(Composition.FromTree(processHistoryTree)); var processHistoryComponentHashBase16 = CommonConversion.StringBase16FromByteArray(processHistoryComponentHash); @@ -1100,7 +1100,7 @@ static public void BuildConfiguration( var webAppConfigFileId = Kalmit.CommonConversion.StringBase16FromByteArray( - Composition.GetHash(Composition.FromTree(Composition.TreeFromSetOfBlobsWithCommonFilePath( + Composition.GetHash(Composition.FromTree(Composition.SortedTreeFromSetOfBlobsWithCommonFilePath( Kalmit.ZipArchive.EntriesFromZipArchive(configZipArchive))))); Console.WriteLine( diff --git a/implement/elm-fullstack/elm-fullstack.csproj b/implement/elm-fullstack/elm-fullstack.csproj index bf294717..4567cb4e 100644 --- a/implement/elm-fullstack/elm-fullstack.csproj +++ b/implement/elm-fullstack/elm-fullstack.csproj @@ -5,8 +5,8 @@ netcoreapp3.1 elm_fullstack elm-fullstack - 2020.0711.0.0 - 2020.0711.0.0 + 2020.0716.0.0 + 2020.0716.0.0