Skip to content

feat: create Intercom customer requests#720

Open
jaeyunha wants to merge 4 commits into
stagingfrom
issue-576-p1-intercom-create-link-issues-fro
Open

feat: create Intercom customer requests#720
jaeyunha wants to merge 4 commits into
stagingfrom
issue-576-p1-intercom-create-link-issues-fro

Conversation

@jaeyunha

Copy link
Copy Markdown
Member

Summary

  • Persist Intercom conversation customer mappings into customer when creating or linking an issue.
  • Upsert customer_request rows for Intercom conversations with provider metadata, source URL, and linked issue.
  • Clear the linked customer request issue reference when an Intercom conversation is unlinked.

Verification

  • docker run --rm -v "$PWD":/work -w /work/apps/api golang:1.25 go test ./internal/integrations -run Intercom passed.
  • pnpm lint passed.
  • make check currently blocks in pnpm typecheck on pre-existing web Better Auth/Drizzle missing modules (apps/web/src/lib/auth*.ts, apps/web/src/lib/db/*.ts).
  • docker run --rm -v "$PWD":/work -w /work/apps/api golang:1.25 go test ./... currently blocks on existing TestZendeskSetupRequirementAndSubdomain expectation mismatch.

Closes #576

jaeyunha and others added 4 commits June 15, 2026 23:08
- intercomSigningSecret: drop AUTH_INTERCOM_SECRET fallback; return ""
  when INTERCOM_SIGNING_SECRET is absent so the 503 path fires correctly
  instead of accepting requests signed with the OAuth client secret
- IntercomIssueUnlink: check RowsAffected() and return 404 when no row
  matched, consistent with IntercomIssueLink behaviour
- intercomIssueDescriptionHTML: guard Permalink with HasPrefix("https://")
  to block javascript: URI injection before building the <a href>
- IntercomConnect 412 path: replace problem.JSON map with problem.Write
  for RFC 7807 consistency

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jaeyunha

Copy link
Copy Markdown
Member Author

Controller disposition for current head 2cd7951: validation-blocked / rebase required; do not merge as-is.

Evidence:

  • PR feat: create Intercom customer requests #720 targets staging but does not contain current origin/staging; GitHub reports mergeable=CONFLICTING.
  • Merge simulation conflicts in integration startup/router/catalog files, handler_test.go, intercom.go, generated OpenAPI/SDK, and integration settings UI.
  • Branch includes stale P1 Intercom: create/link issues from conversations and create customer requests #576 Intercom branch history plus the new customer-request commit; intended delta needs to be ported onto current staging cleanly.
  • Lane report says Dockerized focused Intercom Go tests and pnpm lint passed, but broad make check is blocked by existing web type deps and broad Go is blocked by unrelated Zendesk expectation mismatch; no GitHub checks are reported.

Required path:

  • Rebase/port the Intercom customer-request delta onto current origin/staging, preserve already-landed Salesforce/Front/Figma/Gong/Jira/Zendesk integration changes during conflict resolution, regenerate OpenAPI/SDK from current contract, then rerun focused Intercom Go + web/SDK gates before merge.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2cd79518b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Name string `json:"name"`
Email string `json:"email"`
App struct {
ID string `json:"id"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Decode Intercom id_code before completing OAuth

Intercom's /me response puts the workspace/app identifier under app.id_code (the OAuth token response does not provide app_id), but this struct only decodes app.id. As a result appID := firstNonEmpty(me.App.ID, me.AppID, token.AppID) remains empty after a successful OAuth exchange, and every Intercom install fails with “did not include an access token and app id.” Add an id_code field and use it when saving the integration.

Useful? React with 👍 / 👎.

problem.Write(w, http.StatusBadRequest, "Intercom action body could not be read", err.Error())
return intercomConversationAction{}, false
}
if !verifyIntercomSignature(secret, r.Header.Get("X-Hub-Signature"), r.Header.Get("X-Intercom-Signature"), body) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Accept Canvas Kit X-Body-Signature callbacks

These issue action endpoints are intended for Intercom Canvas Kit POST callbacks, which are signed with X-Body-Signature using HMAC-SHA256, not the webhook-only X-Hub-Signature. In that context, legitimate search/link/create/status requests that only include X-Body-Signature will be rejected with 401 before any issue work runs. Verify that header here as well.

Useful? React with 👍 / 👎.

authorizationUrl: { type: string, format: uri }
state: { type: string }
workspaceSlug: { type: string }
IntercomConnectResponse:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Define the Intercom connect response schema

IntercomConnectResponse is declared with no schema, so the new /integrations/intercom/connect 200 response $ref resolves to null and the generated SDK exposes IntercomConnectResponse as never. Type-safe clients therefore cannot read the authorizationUrl needed to redirect users even though the handler returns it. Give this component the same shape as the other OAuth connect responses.

Useful? React with 👍 / 👎.

{Provider: "jira", Name: "Jira", Description: "Sync issue status, ownership, and cross-links with Jira projects."},
{Provider: "discord", Name: "Discord", Description: "Create, search, and share issues from Discord slash commands."},
{Provider: "microsoft_teams", Name: "Microsoft Teams", Description: "Create issues and projects from Teams conversations and post project updates."},
{Provider: "intercom", Name: "Intercom", Description: "Create and link issues from support conversations and sync customer feedback status."},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add intercom to the integration provider contract

This new catalog entry makes GET /integrations return provider: "intercom", but the OpenAPI Integration.provider enum and generated SDK union still omit that value. Any SDK consumer using the documented list response gets an impossible provider value and cannot handle the new integration type without casting. Add intercom to the enum alongside this catalog change.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant