Document local cloud startup and harden persistence

This commit is contained in:
Jacob Dubin
2026-05-25 00:30:41 -05:00
parent c36a01b142
commit 4e816e175a
17 changed files with 517 additions and 9 deletions

View File

@@ -8,6 +8,15 @@ This is the production-oriented path for restoring device connectivity and creat
Current spoken cloud version: `Cloud version 1.0.19.`
Local startup:
```powershell
.\scripts\cloud\Start-OpenJiboDotNet.ps1
```
Run that from the repo root. For the full local guide, including Node and Playground, see
[local-cloud-quickstart.md](../../../docs/local-cloud-quickstart.md).
Release hygiene reminder:
- bump [OpenJiboCloudBuildInfo.cs](/C:/Projects/JiboExperiments/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/OpenJiboCloudBuildInfo.cs) whenever we ship a meaningful hosted-cloud update

View File

@@ -239,4 +239,6 @@ static CloudSession ResolveSession(JiboWebSocketService webSocketService, WebSoc
return webSocketService.GetOrCreateSession(envelope);
}
internal sealed record ReceivedSocketMessage(WebSocketMessageType MessageType, byte[] Buffer);
internal sealed record ReceivedSocketMessage(WebSocketMessageType MessageType, byte[] Buffer);
public partial class Program;

View File

@@ -123,7 +123,7 @@ public sealed class CloudStateCommuteReportProvider(ICloudStateStore cloudStateS
return true;
}
private static string? ResolveLoopId(TurnContext turn)
private static string ResolveLoopId(TurnContext turn)
{
if (turn.Attributes.TryGetValue("loopId", out var loopValue) &&
loopValue is not null &&
@@ -147,4 +147,4 @@ public sealed class CloudStateCommuteReportProvider(ICloudStateStore cloudStateS
return null;
}
}
}

View File

@@ -25,6 +25,22 @@ internal sealed class JsonFileSnapshotStore(string? persistencePath, JsonSeriali
var directory = Path.GetDirectoryName(persistencePath);
if (!string.IsNullOrWhiteSpace(directory)) Directory.CreateDirectory(directory);
File.WriteAllText(persistencePath, JsonSerializer.Serialize(snapshot, options));
var tempPath = Path.Combine(
string.IsNullOrWhiteSpace(directory) ? Directory.GetCurrentDirectory() : directory,
$".{Path.GetFileName(persistencePath)}.{Guid.NewGuid():N}.tmp");
try
{
File.WriteAllText(tempPath, JsonSerializer.Serialize(snapshot, options));
if (File.Exists(persistencePath))
File.Replace(tempPath, persistencePath, null);
else
File.Move(tempPath, persistencePath);
}
finally
{
if (File.Exists(tempPath)) File.Delete(tempPath);
}
}
}
}