Promote strict livestore mode to default sync engine
Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
1 parent
e7d37a3643
commit
842435e622
4 files changed
+10
-10
No files matched your search
@@ -105,11 +105,11 @@ T3 Code has a global runtime mode switch in the chat toolbar:
|
||||
|
||||
The server supports feature-flagged sync-engine modes while migrating from the legacy in-house state sync pipeline to LiveStore.
|
||||
|
||||
- `T3CODE_SYNC_ENGINE_MODE=livestore-read-pilot` (default)
|
||||
- `T3CODE_SYNC_ENGINE_MODE=livestore` (default)
|
||||
- Uses the LiveStore-backed read path and disables delegate fallback (strict mirror-read mode).
|
||||
- `T3CODE_SYNC_ENGINE_MODE=livestore-read-pilot`
|
||||
- Uses the LiveStore mirror for `state.bootstrap`, `state.catchUp`, and `state.listMessages` reads when available.
|
||||
- Automatically falls back to legacy reads if the mirror is unavailable or errors.
|
||||
- `T3CODE_SYNC_ENGINE_MODE=livestore`
|
||||
- Uses the same LiveStore-backed read path as read-pilot, but disables delegate fallback (strict mirror-read mode).
|
||||
- `T3CODE_SYNC_ENGINE_MODE=legacy`
|
||||
- Uses the existing `PersistenceService`-backed state sync engine for reads and writes.
|
||||
- `T3CODE_SYNC_ENGINE_MODE=shadow`
|
||||
|
||||
@@ -6,8 +6,8 @@ This runbook describes how to operate and verify the LiveStore migration path sa
|
||||
|
||||
Server mode is controlled by `T3CODE_SYNC_ENGINE_MODE`:
|
||||
|
||||
- `livestore-read-pilot` (default): write path remains legacy-backed, but state reads prefer LiveStore mirror with delegate fallback.
|
||||
- `livestore`: same read path as read-pilot, but with delegate read fallback disabled (strict mirror-read mode).
|
||||
- `livestore` (default): strict LiveStore read path (delegate read fallback disabled).
|
||||
- `livestore-read-pilot`: write path remains legacy-backed, but state reads prefer LiveStore mirror with delegate fallback.
|
||||
- `legacy`: legacy persistence service is canonical for reads/writes.
|
||||
- `shadow`: legacy remains canonical, and `state.event` writes are mirrored into LiveStore.
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ import { describe, expect, it } from "vitest";
|
||||
import { assertSyncEngineModeAllowed, resolveSyncEngineMode } from "./syncEngineMode";
|
||||
|
||||
describe("resolveSyncEngineMode", () => {
|
||||
it("defaults to livestore-read-pilot when env var is missing", () => {
|
||||
expect(resolveSyncEngineMode(undefined)).toBe("livestore-read-pilot");
|
||||
expect(resolveSyncEngineMode("")).toBe("livestore-read-pilot");
|
||||
expect(resolveSyncEngineMode(" ")).toBe("livestore-read-pilot");
|
||||
it("defaults to livestore when env var is missing", () => {
|
||||
expect(resolveSyncEngineMode(undefined)).toBe("livestore");
|
||||
expect(resolveSyncEngineMode("")).toBe("livestore");
|
||||
expect(resolveSyncEngineMode(" ")).toBe("livestore");
|
||||
});
|
||||
|
||||
it("accepts supported mode values case-insensitively", () => {
|
||||
|
||||
@@ -9,7 +9,7 @@ const VALID_SYNC_ENGINE_MODES: ReadonlySet<SyncEngineMode> = new Set([
|
||||
|
||||
export function resolveSyncEngineMode(raw: string | undefined): SyncEngineMode {
|
||||
if (!raw || raw.trim().length === 0) {
|
||||
return "livestore-read-pilot";
|
||||
return "livestore";
|
||||
}
|
||||
const normalized = raw.trim().toLowerCase();
|
||||
if (VALID_SYNC_ENGINE_MODES.has(normalized as SyncEngineMode)) {
|
||||
|
||||
Reference in new issue
Block a user