Skip to content

Orphaned byMessageId entries with emptied activeBlockIds stay visible forever #372

Description

@ranxianglei

来源: #368 (#368) 分析 "compress-call reasoning inflates the incompressible floor" 时发现

问题

filterCompressedRanges 中,当某条消息的 byMessageId 条目的 activeBlockIds 被清空(但条目本身仍存在)时,survive[i] 被置为 true,导致该消息永久可见,即使它本应被压缩 / 隐藏。

证据

  • lib/messages/prune.ts:60-66:62-63):
    const pruneEntry = state.prune.byMessageId[messageId];
    survive[i] = !pruneEntry || pruneEntry.activeBlockIds.length === 0;
    即:无条目 → survive;或条目存在但 activeBlockIds 为空 → survive。
  • 当 block 被 deactivate 但 byMessageId 条目未清理时,activeBlockIds 变空 → 消息变回可见。

影响

建议修复

根因在 activeBlockIds 清空后 byMessageId 条目未同步删除 / 标记。需排查 block deactivate 路径(syncCompressionBlocks / GC)是否应清理 byMessageId 条目,或让 filterCompressedRanges 区分"从未压缩"与"已压缩但 block 已失效"两种情况。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions