Skip to content

test: add coverage for email identity fallback chain #14

Description

@MathurAditya724

Tracking issue from review of #13.

identifyEmail in packages/opencode-webhooks/src/email/identity.ts walks a fallback chain (Message-ID → In-Reply-To → References[i]) but has no tests. A regression in regex order or references iteration order would only surface at runtime.

The repo has no test infrastructure today; this issue tracks adding it alongside coverage for at least:

  • identification via message_id (primary path)
  • fallback to in_reply_to when message_id is unrecognized
  • fallback to a matching entry in references[] when both above miss
  • all-unknown input returns { kind: "unknown" }

Once test infra exists, these should be straightforward unit tests against the pure identifyEmail function.

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