History

feat(orchestration): bound thread history and resume payloads

- Add paginated thread history with bounded snapshots and replay limits - Trim oversized wire payloads and support progressive mobile history loading

Julius Marminge committed 3 months ago

Commit 7d42d311 parent e3883a943 files · +4239 −211Browse files

Showing the changes to packages/client-runtime/src/state/shellReducer.ts (1 of 43 files). Show all

Unified · Split

packages/client-runtime/src/state/shellReducer.ts+6−6
@@ -29,8 +29,8 @@ function retainRepositoryIdentity( · 28 unmodified lines
2929
3030 export interface MergeShellSnapshotOptions {
3131 /**
32− * Enrichment refresh: structure and sequence must not roll back when at or
33− * below cache; listed roots accept identity exactly (including null).
32+ * Metadata-only enrichment refresh: structure and sequence never change;
33+ * listed roots accept identity exactly (including null).
3434 * Omit this options object for authoritative HTTP/initial WebSocket snapshots.
3535 */
3636 readonly resolvedRepositoryIdentityRoots: ReadonlyArray<string>;
@@ -43,9 +43,9 @@ export interface MergeShellSnapshotOptions { · 6 unmodified lines
4343 * lower than cache, while retaining a prior non-null identity when the candidate
4444 * is still unresolved/null for the same root.
4545 *
46− * Enrichment snapshots (options present) never resurrect or roll back
47− * projects/threads/archives/sequence when at or below cache; they only patch
48− * repository identity for matching current projects.
46+ * Enrichment snapshots (options present) only patch repository identity for
47+ * matching current projects. They never replace projects, threads, archives,
48+ * or sequence, regardless of the incoming snapshot sequence.
4949 */
5050 export function mergeShellSnapshotProjects(
5151 previous: OrchestrationV2ShellSnapshot | null | undefined,
@@ -59,7 +59,7 @@ export function mergeShellSnapshotProjects( · 7 unmodified lines
5959 const isEnrichment = options !== undefined;
6060 const resolvedRootSet = isEnrichment ? new Set(options.resolvedRepositoryIdentityRoots) : null;
6161
62− if (isEnrichment && next.snapshotSequence <= previous.snapshotSequence) {
62+ if (isEnrichment) {
6363 const nextById = new Map(next.projects.map((project) => [project.id, project] as const));
6464 return {
6565 ...previous,