- Add paginated thread history with bounded snapshots and replay limits - Trim oversized wire payloads and support progressive mobile history loading
Showing the changes to packages/client-runtime/src/state/shellReducer.ts (1 of 43 files). Show all
Unified · Split
| @@ -29,8 +29,8 @@ function retainRepositoryIdentity( · 28 unmodified lines | |||
| 29 | 29 | ||
| 30 | export interface MergeShellSnapshotOptions { | 30 | export interface MergeShellSnapshotOptions { |
| 31 | /** | 31 | /** |
| 32 | * Enrichment refresh: structure and sequence must not roll back when at or | 32 | * Metadata-only enrichment refresh: structure and sequence never change; |
| 33 | * below cache; listed roots accept identity exactly (including null). | 33 | * listed roots accept identity exactly (including null). |
| 34 | * Omit this options object for authoritative HTTP/initial WebSocket snapshots. | 34 | * Omit this options object for authoritative HTTP/initial WebSocket snapshots. |
| 35 | */ | 35 | */ |
| 36 | readonly resolvedRepositoryIdentityRoots: ReadonlyArray<string>; | 36 | readonly resolvedRepositoryIdentityRoots: ReadonlyArray<string>; |
| @@ -43,9 +43,9 @@ export interface MergeShellSnapshotOptions { · 6 unmodified lines | |||
| 43 | * lower than cache, while retaining a prior non-null identity when the candidate | 43 | * lower than cache, while retaining a prior non-null identity when the candidate |
| 44 | * is still unresolved/null for the same root. | 44 | * is still unresolved/null for the same root. |
| 45 | * | 45 | * |
| 46 | * Enrichment snapshots (options present) never resurrect or roll back | 46 | * Enrichment snapshots (options present) only patch repository identity for |
| 47 | * projects/threads/archives/sequence when at or below cache; they only patch | 47 | * matching current projects. They never replace projects, threads, archives, |
| 48 | * repository identity for matching current projects. | 48 | * or sequence, regardless of the incoming snapshot sequence. |
| 49 | */ | 49 | */ |
| 50 | export function mergeShellSnapshotProjects( | 50 | export function mergeShellSnapshotProjects( |
| 51 | previous: OrchestrationV2ShellSnapshot | null | undefined, | 51 | previous: OrchestrationV2ShellSnapshot | null | undefined, |
| @@ -59,7 +59,7 @@ export function mergeShellSnapshotProjects( · 7 unmodified lines | |||
| 59 | const isEnrichment = options !== undefined; | 59 | const isEnrichment = options !== undefined; |
| 60 | const resolvedRootSet = isEnrichment ? new Set(options.resolvedRepositoryIdentityRoots) : null; | 60 | const resolvedRootSet = isEnrichment ? new Set(options.resolvedRepositoryIdentityRoots) : null; |
| 61 | 61 | ||
| 62 | if (isEnrichment && next.snapshotSequence <= previous.snapshotSequence) { | 62 | if (isEnrichment) { |
| 63 | const nextById = new Map(next.projects.map((project) => [project.id, project] as const)); | 63 | const nextById = new Map(next.projects.map((project) => [project.id, project] as const)); |
| 64 | return { | 64 | return { |
| 65 | ...previous, | 65 | ...previous, |