Fix JsonStorage temp file truncation

Merged
TA
2mo ago
+53-3

Summary

  • Fix JsonStorage.SaveAsync so an existing .tmp file is truncated before writing new JSON.
  • Add a regression test for saving shorter JSON over a longer temp file.

Verification

dotnet test Flow.Launcher.Test/Flow.Launcher.Test.csproj --filter FullyQualifiedName~Flow.Launcher.Test.JsonStorageTest.SaveAsync_WhenExistingTempFileIsLonger_OverwritesWithoutTrailingBytesAsync

Passed: 1, Failed: 0.