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.
Tracking issue from review of #13.
identifyEmailinpackages/opencode-webhooks/src/email/identity.tswalks a fallback chain (Message-ID → In-Reply-To → References[i]) but has no tests. A regression in regex order orreferencesiteration order would only surface at runtime.The repo has no test infrastructure today; this issue tracks adding it alongside coverage for at least:
message_id(primary path)in_reply_towhenmessage_idis unrecognizedreferences[]when both above miss{ kind: "unknown" }Once test infra exists, these should be straightforward unit tests against the pure
identifyEmailfunction.