From cb12830fd437cf5578cf87d0296dff0a44e392cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20R=C3=A4tzel?= Date: Thu, 10 Aug 2023 20:48:46 +0000 Subject: [PATCH] Fix out of range exception --- implement/elm-time/ElmTime/ProcessStore.cs | 2 +- .../ProcessStoreSupportingMigrations.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/implement/elm-time/ElmTime/ProcessStore.cs b/implement/elm-time/ElmTime/ProcessStore.cs index 939be53b..a4740b6d 100644 --- a/implement/elm-time/ElmTime/ProcessStore.cs +++ b/implement/elm-time/ElmTime/ProcessStore.cs @@ -135,7 +135,7 @@ public IEnumerable EnumerateSerializedCompositionsRecordsReverse() => https://github.com/elm-time/elm-time/blob/1cd3f00bdf5a05e9bda479c534b0458b2496393c/implement/PersistentProcess/PersistentProcess.Common/ProcessStore.cs#L183 Looking at the files from stores in production, it seems like that caused addition of BOM. */ - fileContent.Value[..3].Span.SequenceEqual(new byte[] { 0xEF, 0xBB, 0xBF }) + fileContent.Value.Span.StartsWith(new byte[] { 0xEF, 0xBB, 0xBF }) ? 3 : diff --git a/implement/elm-time/Platform/WebService/ProcessStoreSupportingMigrations/ProcessStoreSupportingMigrations.cs b/implement/elm-time/Platform/WebService/ProcessStoreSupportingMigrations/ProcessStoreSupportingMigrations.cs index 732fa0f9..0af86b08 100644 --- a/implement/elm-time/Platform/WebService/ProcessStoreSupportingMigrations/ProcessStoreSupportingMigrations.cs +++ b/implement/elm-time/Platform/WebService/ProcessStoreSupportingMigrations/ProcessStoreSupportingMigrations.cs @@ -313,7 +313,7 @@ public ProcessStoreReaderInFileStore(IFileStoreReader fileStore) https://github.com/elm-time/elm-time/blob/1cd3f00bdf5a05e9bda479c534b0458b2496393c/implement/PersistentProcess/PersistentProcess.Common/ProcessStore.cs#L183 Looking at the files from stores in production, it seems like that caused addition of BOM. */ - fileContent.Value[..3].Span.SequenceEqual(new byte[] { 0xEF, 0xBB, 0xBF }) + fileContent.Value.Span.StartsWith(new byte[] { 0xEF, 0xBB, 0xBF }) ? 3 :