- 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 | 30 | export interface MergeShellSnapshotOptions { |
| 31 | 31 | /** |
| 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). | |
| 34 | 34 | * Omit this options object for authoritative HTTP/initial WebSocket snapshots. |
| 35 | 35 | */ |
| 36 | 36 | readonly resolvedRepositoryIdentityRoots: ReadonlyArray<string>; |
| @@ -43,9 +43,9 @@ export interface MergeShellSnapshotOptions { · 6 unmodified lines | ||
| 43 | 43 | * lower than cache, while retaining a prior non-null identity when the candidate |
| 44 | 44 | * is still unresolved/null for the same root. |
| 45 | 45 | * |
| 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. | |
| 49 | 49 | */ |
| 50 | 50 | export function mergeShellSnapshotProjects( |
| 51 | 51 | previous: OrchestrationV2ShellSnapshot | null | undefined, |
| @@ -59,7 +59,7 @@ export function mergeShellSnapshotProjects( · 7 unmodified lines | ||
| 59 | 59 | const isEnrichment = options !== undefined; |
| 60 | 60 | const resolvedRootSet = isEnrichment ? new Set(options.resolvedRepositoryIdentityRoots) : null; |
| 61 | 61 | |
| 62 | − if (isEnrichment && next.snapshotSequence <= previous.snapshotSequence) { | |
| 62 | + if (isEnrichment) { | |
| 63 | 63 | const nextById = new Map(next.projects.map((project) => [project.id, project] as const)); |
| 64 | 64 | return { |
| 65 | 65 | ...previous, |