Skip to content

[Sync] Built-in gmail/threads profile: identity keys for all participants #129

@moekatib

Description

@moekatib

Problem

The current `gmail/threads` sync profile has no `identityKey` declared. Even once #128 lands (plural identityKeys), the built-in profile needs to actually use it so Gmail threads join to Attio/HubSpot contacts via shared email.

Today the profile uses a jq transform that only extracts `from_email` (first sender of first message) as a flat column — not as an identity key, and it misses to/cc/bcc participants.

Proposed

Update the built-in `gmail/threads` profile to:

  1. Declare `identityKeys` (from [Sync] identityKeys (plural) — multiple cross-platform identity keys per record #128) covering every message's `From`, `To`, `Cc` headers across the whole thread.
  2. Normalize values: strip display names (`"Jane [email protected]"` → `[email protected]`), lowercase, trim.
  3. Move the existing `from_email` extraction out of the user-editable `gmail-extract.jq` and into the built-in profile so users get this by default without copying a transform.

Acceptance

  • Fresh `sync init gmail threads` produces a profile with participant identity keys populated.
  • Running `sync run gmail --models threads` writes records with keys like:
    `["gmail/threads:", "email:[email protected]", "email:[email protected]", ...]`
  • Query `one mem list gmail/threads` shows N identity keys per thread (not 0, not 1).
  • Built-in profile's `sync test` preview shows the resolved identity keys.

Blocked on

#128 (identityKeys plural)

Related

Part of the cross-platform identity story. Found during PR #125 testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions