Skip to content

snapshot: a refusal's details.index names a node in a tree the caller cannot list #4701

Closed

Description

@thymikee

Purpose

When a regular snapshot is refused, error.details.index names a node in a tree the caller cannot list. The refusal fires from the host's projected/compacted tree, while the recovery advice in the same message family points at snapshot --raw, which is a different tree. Nothing states the two index spaces, so the number cannot be used to find the node.

#4654 reported this as its second finding: details.index: 11, then 13 after focus moved, while raw index 11 was a full-screen container and raw 13 a 1728x41 cell — neither is the escaping node. #4700 fixes that report's tvOS refusal and deliberately leaves this provenance gap open, because the gap is independent of it.

Evidence

Source at 7610947604:

  • packages/capture-kit/src/ios-snapshot-engine/runner-presentation.ts re-indexes the payload (compactRunnerPayload) whenever the request is a regular interactive one, and validateRunnerOutput then validates that re-indexed array.
  • packages/capture-kit/src/ios-snapshot-engine/invariants.ts (validateContainedFrame) publishes { index: node.index } from the array it was handed, with no statement of which tree that index belongs to.
  • The same reason and the same index space also fire for a plain snapshot (non-interactive) capture, so the mismatch is not limited to snapshot -i.
  • Reproduced at the production seam: a payload whose escaping node is published at index 5 is refused with details.index: 5 under both interactiveOnly values — on a small tree where compaction happens to be the identity. That is the shape of the bug: the number agrees with the raw tree only when nothing re-indexed it, and a real home screen does re-index it.

Required behavior

Either:

  • details.index names the node as snapshot --raw lists it (report the producer's index, or map through the presentation index mapping the engine already publishes), or
  • the details name the tree the index belongs to, so a reader can resolve it without guessing.

Completion condition: for one refusal, the reported index resolves to the escaping node in the tree the caller is told to read.

Dependencies

Blocked by: none. #4700 does not change this behavior and this does not block that PR.

Owner: the shared error-projection seam (toIosSnapshotEngineErrorDetails and the IosSnapshotEngineFailureDetails contract in packages/capture-kit/src/ios-snapshot-engine/types.ts), which every engine refusal shares — not the tvOS presentation path. The choice between the two options above is a product decision about what a refusal index means across all producers, which is why it is not decided by the tvOS fix.

Activity

  1. added
    needs-triage
    on Nov 18, 2026
  2. apex-sentinel-staging commented on Nov 18, 2026

    @apex-sentinel-staging

    Apex Sentinel · Issue review

    Suggested label: bug

    The issue reports that snapshot refusal errors expose details.index from a compacted/presented tree while the advice points to snapshot --raw, making the index unresolvable, and includes source references plus a reproduction. No text attempts to direct the triage verdict.

    Required sections

    • Steps to reproduce
    • Expected and actual behavior (missing)
    • Version or environment (missing)
  3. added
    bug
    in-progress
    and removed
    needs-triage
    on Nov 19, 2026
  4. removed
    in-progress
    on Nov 21, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions