* 推送 message ID
(id: string)
| 247 | * 这样 messages 数组不再持有该消息的字节,但其对 entries 的状态贡献被永久保留在 base 上。 |
| 248 | * 后续 getSnapshot() 重建时仍然得到完整状态,避免出现 entries=[] 但 seq 飞涨的灾难性结果。 |
| 249 | */ |
| 250 | private foldEvictedIntoBase(removed: LogMsg): void { |
| 251 | if (removed.type === 'patch') { |
| 252 | const base: NormalizedConversation = this.baseSnapshot |
| 253 | ? (JSON.parse(JSON.stringify(this.baseSnapshot)) as NormalizedConversation) |
| 254 | : { entries: [] }; |