Skip to content

[LinkedIn Audiences] Add Company Audience sync action - #3856

Open
joe-ayoub-segment wants to merge 18 commits into
mainfrom
linkedin-company-audience-hooks
Open

[LinkedIn Audiences] Add Company Audience sync action#3856
joe-ayoub-segment wants to merge 18 commits into
mainfrom
linkedin-company-audience-hooks

Conversation

@joe-ayoub-segment

@joe-ayoub-segment joe-ayoub-segment commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a new updateCompanyAudience action to the LinkedIn Audiences destination that syncs companies to a LinkedIn DMP Company Segment (account-based marketing).

JIRA: STRATCONN-6270

What it does

  • New action "Sync To LinkedIn DMP Company Segment"DMP Segment Companies API (POST /dmpSegments/{id}/companies).
  • Segment resolved at runtime in perform: looks up the COMPANY segment for the resolved key (GET /dmpSegments?q=account, filtered to type = COMPANY), creating it if none exists. Result cached 24h. No mapping-save hooks.
  • Explicit Add/Remove: required "Company Segment Action" field, validated to be exactly ADD or REMOVE. Payload membership booleans are ignored — unlike the user action there is no AUTO mode, so mapping both directions requires two mappings (or a transform to ADD/REMOVE).
  • Identifiers: Company Domain → companyWebsiteDomain, LinkedIn Company ID → organizationUrn (bare id wrapped to urn:li:organization:{id}). At least one required; both sent when present.
  • Batching: performBatch with per-item MultiStatusResponse, dedupes same company+action. Hidden batch_size defaults to 5000.

Notes

  • updateAudience (user) action unchanged.
  • Replaced the destination-level __tests__/snapshot.test.ts with per-action snapshot tests.

Testing

  • Unit tests: single + batch perform (ADD/REMOVE), identifier validation, org-URN wrapping, lookup/create, retry classification, per-element failures. Full linkedin-audiences suite passes.

🤖 Generated with Claude Code

Add a new updateCompanyAudience action that syncs companies to LinkedIn
DMP Company Segments (account-based marketing), built against LinkedIn's
documented /dmpSegments/{id}/companies API (flat companyWebsiteDomain /
organizationUrn fields).

- retlOnMappingSave + onMappingSave hooks let the user create a new
  Company Audience or select an existing COMPANY-type segment from a
  dynamic dropdown.
- Add/remove is governed by an explicit required "Company Segment Action"
  field (no default), not by audience membership in the payload.
- Batch support with per-item MultiStatusResponse; hidden batch_size
  defaults to 5000 (the LinkedIn per-request max).

Removed the destination-level snapshot.test.ts, which is incompatible
with hook-gated actions; per-action snapshot coverage is retained.

STRATCONN-6270

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings July 6, 2026 18:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds a new LinkedIn Audiences destination action for syncing company identifiers to LinkedIn DMP COMPANY segments, including mapping-save hooks to create/select the target segment.

Changes:

  • Added updateCompanyAudience action with fields, batching support, and snapshot + unit tests.
  • Implemented mapping-save hook to create or select a COMPANY-type DMP segment via LinkedIn APIs.
  • Extended LinkedInAudiences API client and destination registration/metadata to support DMP segment + companies endpoints.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/index.ts Registers the new action and wires perform/performBatch + hooks.
packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/functions.ts Validates payloads, builds LinkedIn companies request JSON, sends batch update, and maps MultiStatus per-item results.
packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/hooks.ts Implements mapping-save hook logic and dynamic dropdown for COMPANY segments.
packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/fields.ts Defines action fields including identifiers, explicit ADD/REMOVE choice, and hidden batching controls.
packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/types.ts Adds local types for segments, hook IO, and LinkedIn batch responses.
packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/constants.ts Adds constants for org URN prefix, Rest.li protocol version, segment types, and action values.
packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/generated-types.ts Generated payload and hook IO typings for the new action.
packages/destination-actions/src/destinations/linkedin-audiences/api.ts Adds LinkedIn API client methods for listing/reading/creating DMP segments and posting companies batch updates.
packages/destination-actions/src/destinations/linkedin-audiences/index.ts Registers updateCompanyAudience on the destination.
packages/destination-actions/src/destinations/linkedin-audiences/metadata.json Publishes the new action + hook + fields to metadata.
packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/tests/index.test.ts Unit coverage for URN wrapping, validation, single + batch sync, retries, and hook create/select paths.
packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/tests/snapshot.test.ts Adds action-level snapshot tests (with hookOutputs injected) for required/all fields mapping.
packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/tests/snapshots/snapshot.test.ts.snap Snapshot outputs for the new action.
packages/destination-actions/src/destinations/linkedin-audiences/tests/snapshot.test.ts Removes destination-level snapshot test that auto-ran all actions (incompatible with hook-gated actions).
packages/destination-actions/src/destinations/linkedin-audiences/tests/snapshots/snapshot.test.ts.snap Removes snapshots tied to the deleted destination-level snapshot test.

Comment thread packages/destination-actions/src/destinations/linkedin-audiences/api.ts Outdated
- Classify the batch HTTP response by status instead of blanket-retrying
  every non-200: 401 -> InvalidAuthenticationError (triggers token
  refresh), 429/5xx -> RetryableError with the real status, other 4xx
  (400/404) -> non-retryable APIError.
- Treat a missing per-company result (LinkedIn returns fewer elements
  than sent) as a non-retryable 400, not a retryable 500.
- Fix per-item sent/body to match the codebase convention: sent = the
  element sent to LinkedIn, body = the Segment payload.
- Move RETRYABLE_STATUSES into the action's constants.ts.
- Add tests for 401/429/500/400/404 paths, the truncated-response case,
  and sent/body contents.

STRATCONN-6270

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
joe-ayoub-segment added a commit that referenced this pull request Jul 7, 2026
Copies the LinkedIn DMP Company Segment sync action (account-based
marketing) from linkedin-company-audience-hooks (PR #3856) so we can
build e2e-framework tests against it.

- New updateCompanyAudience action + api.ts methods + index.ts registration
- Deletes the destination-level snapshot.test.ts (incompatible with
  hook-gated actions), matching the source PR.
- Intentionally omits metadata.json: this branch deliberately strips
  metadata.json from all destinations (kept only for amplitude).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ports the improvements developed on the e2e branch back into this branch
(e2e config/fixtures intentionally excluded):

- Dedupe same-company+action payloads within a batch into one element
  sent to LinkedIn (keyed on normalized domain + organization URN), and
  fan LinkedIn's per-item result back to every original payload index.
- Bump LINKEDIN_AUDIENCES_API_VERSION 202505 -> 202506: 202505 is sunset
  and returns HTTP 426; 202506 verified active for the DMP segment
  companies and users endpoints.
- Unit test asserting the exact per-item MultiStatusResponse for the
  dedup scenario (case/whitespace/bare-id-vs-URN normalization plus
  interleaved no-identifier failures).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 7, 2026 17:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Comment thread packages/destination-actions/src/destinations/linkedin-audiences/api.ts Outdated
Copilot AI review requested due to automatic review settings July 8, 2026 09:56
joe-ayoub-segment added a commit that referenced this pull request Jul 8, 2026
…zation

Ports the fixes made on linkedin-company-audience-hooks (PR #3856):
- api.ts: add LinkedIn-Version header to the DMP segment hook endpoints
  (listDmpSegmentsByAccount, getDmpSegmentById, createCompanyDmpSegment);
  without it LinkedIn returns 400 VERSION_MISSING.
- functions.ts: treat any 2xx as success (was strict === 200); normalize
  identifiers once in validate() (trim + lowercase domain, trim id,
  whitespace-only treated as missing) so dedupe key and sent JSON agree.
- Update dedup unit test + regenerate snapshots for the normalized
  (lower-cased) domain and the 202506 version.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings July 15, 2026 10:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings July 15, 2026 10:32
@joe-ayoub-segment
joe-ayoub-segment marked this pull request as ready for review July 15, 2026 10:44
@joe-ayoub-segment
joe-ayoub-segment requested a review from a team as a code owner July 15, 2026 10:44
@joe-ayoub-segment joe-ayoub-segment self-assigned this Jul 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings July 15, 2026 11:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings July 17, 2026 12:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Comment thread packages/destination-actions/src/destinations/linkedin-audiences/metadata.json Outdated
Copilot AI review requested due to automatic review settings July 17, 2026 12:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

…de tests

- versioning-info.ts: 202506 was rolled off LinkedIn's active version window
  (NONEXISTENT_VERSION / HTTP 426); bump stable to 202511.
- updateCompanyAudience unit tests: prove dmp_company_action governs add/remove
  even when an Engage/RETL membership boolean at properties[computation_key]
  says otherwise, and when no boolean is present.
- Regenerate updateAudience snapshot for the linkedin-version header change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 14:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

…perties

Change the identifiers field default to check $.traits.* first and fall back to
$.properties.* (via @if), so events from either shape resolve the company domain
and LinkedIn company id. Formatting sync for the test file.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 17:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Resolve conflicts:
- versioning-info.ts: take main's LINKEDIN_AUDIENCES_API_VERSION=202604
- updateAudience snapshot: linkedin-version header 202604
- root __tests__ snapshot: keep deletion (tests moved to per-action snapshots)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 5, 2026 16:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

Suppressed comments (4)

packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/functions.ts:64

  • If dmp_company_action is set to an unexpected value (anything other than REMOVE), this silently coerces to ADD. Since the PR description states the action is explicit (no default), this should be validated and rejected with a PayloadValidationError (and in batch mode, set a per-item error) when dmp_company_action is not one of ADD/REMOVE.
export function companyKey(payload: ValidCompanyPayload): string {
  const { companyDomain, linkedInCompanyId } = payload.identifiers ?? {}
  const domain = companyDomain ?? ''
  const urn = linkedInCompanyId ? toOrganizationUrn(linkedInCompanyId) : ''
  const action =
    payload.dmp_company_action === AUDIENCE_ACTION.REMOVE ? AUDIENCE_ACTION.REMOVE : AUDIENCE_ACTION.ADD
  return `${action}::${domain}::${urn}`
}

packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/functions.ts:205

  • The retryable conflict branch throws a RetryableError with status 429 even though the triggering HTTP status is 409. This misreports the failure mode downstream (logs/metrics/error objects) and can confuse operators. Pass through 409 (or the original status) instead of hardcoding 429.
  if (status === 409) {
    throw new RetryableError(
      'Conflict while updating the LinkedIn DMP Company Segment. This batch will be retried.',
      429
    )
  }

packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/functions.ts:272

  • Caching behavior is inconsistent: existing segment IDs are cached with a 24h TTL, but newly created segment IDs are cached with an empty options object (likely a different/default retention). Use a consistent TTL (e.g., also { hour: 24 }) to avoid unexpectedly long-lived stale cache entries and to keep cache behavior predictable.
  if (existing?.id) {
    const dmpSegmentId = `${existing.id}`
    stateContext?.setResponseContext?.(cacheKey, dmpSegmentId, { hour: 24 })
    return dmpSegmentId
  }

  const dmpSegmentId = await createCompanyDmpSegment(linkedinApiClient, settings, sourceSegmentId, statsContext)
  stateContext?.setResponseContext?.(cacheKey, dmpSegmentId, {})
  return dmpSegmentId

packages/destination-actions/src/destinations/linkedin-audiences/api.ts:6

  • The shared API client now depends on an action-scoped module path (./updateCompanyAudience/constants). This couples the destination-level API layer to a specific action folder, making future refactors (renaming/removing actions) riskier and creating an odd dependency direction. Consider moving shared constants like LINKEDIN_PROTOCOL_VERSION and SEGMENT_TYPES to a destination-level constants/types module (e.g., destinations/linkedin-audiences/constants.ts), and import from there.
import { LINKEDIN_PROTOCOL_VERSION, SEGMENT_TYPES } from './updateCompanyAudience/constants'

Copilot AI review requested due to automatic review settings August 5, 2026 16:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Suppressed comments (4)

packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/functions.ts:166

  • When a single-item call fails via elements[0] (HTTP 200 + per-element non-2xx), the thrown error only includes the status code and drops LinkedIn’s per-element error.message. Consider incorporating element.error.message into the thrown error message (e.g., pass an optional message into handleRequestError or throw an APIError/IntegrationError that includes LinkedIn’s message) so users get actionable feedback.
  if (!isBatch) {
    // LinkedIn's batch-style endpoint can return HTTP 200 while reporting a per-element failure.
    // For single-item perform, inspect the first element result and throw if it is not 2xx.
    const element = response.data?.elements?.[0]
    if (!element || element.status < 200 || element.status >= 300) {
      handleRequestError(element?.status ?? 400, statsContext)
    }
    return response
  }

packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/functions.ts:211

  • The 409 conflict path throws a RetryableError but reports the status as 429, which misrepresents the upstream response and can distort metrics/diagnostics. Prefer passing 409 (or the original status) as the retry status so observability reflects the real failure mode.
  if (status === 409) {
    throw new RetryableError(
      'Conflict while syncing to the LinkedIn DMP Company Segment. This event will be retried.',
      429
    )
  }

packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/functions.ts:278

  • Cache TTL is inconsistent: existing segments are cached for 24 hours, but newly created segments are stored with an empty options object. If {} implies no/short TTL in this runtime, this can cause needless repeat lookups (and potentially repeat create attempts after cache expiry behavior differs). Align the TTL for created segments with the existing-segment path (e.g., also cache for 24 hours).
  if (existing?.id) {
    const dmpSegmentId = `${existing.id}`
    stateContext?.setResponseContext?.(cacheKey, dmpSegmentId, { hour: 24 })
    return dmpSegmentId
  }

  const dmpSegmentId = await createCompanyDmpSegment(linkedinApiClient, settings, sourceSegmentId, statsContext)
  stateContext?.setResponseContext?.(cacheKey, dmpSegmentId, {})
  return dmpSegmentId

packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/index.ts:17

  • The return await is redundant in async functions here and can be simplified to return send(...) to reduce noise (behavior is the same since there is no local try/catch that relies on await).
  perform: async (request, { settings, payload, statsContext, stateContext, features }) => {
    return await send(request, settings, [payload], false, statsContext, stateContext, features)
  },
  performBatch: async (request, { settings, payload, statsContext, stateContext, features }) => {
    return await send(request, settings, payload, true, statsContext, stateContext, features)
  }

Copilot AI review requested due to automatic review settings August 5, 2026 16:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/functions.ts:213

  • This converts an upstream 409 (conflict) into a thrown RetryableError with status 429, which misreports the failure mode (and can affect retry/backoff/alerting semantics). Prefer preserving the original status (409) when throwing, even if that requires widening the accepted status type/cast for RetryableError (or adjusting the union cast used below so 409 is allowed).
  if (status === 409) {
    throw new RetryableError(
      `Conflict while syncing to the LinkedIn DMP Company Segment. This event will be retried.${suffix}`,
      429
    )
  }

Copilot AI review requested due to automatic review settings August 5, 2026 17:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

Suppressed comments (3)

packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/functions.ts:213

  • The 409 conflict path throws a RetryableError with status 429, which misrepresents the upstream response and can affect downstream error handling/metrics. Prefer preserving the actual status code (409) by widening/casting the allowed type (or adjusting RetryableError typing/usage) so the thrown error reflects the real HTTP status.
  if (status === 409) {
    throw new RetryableError(
      `Conflict while syncing to the LinkedIn DMP Company Segment. This event will be retried.${suffix}`,
      429
    )
  }

packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/functions.ts:116

  • In batch mode, segment resolution uses only validPayloads[0]. If a batch ever contains mixed audience_source / segment_name / computation_key values (e.g., due to custom batch_keys or hidden-field overrides), companies could be synced to the wrong segment silently. Consider asserting that all validPayloads resolve to the same sourceSegmentId (or computing segmentId per group and splitting requests / setting per-item errors) before proceeding.
  let segmentId: string
  try {
    segmentId = await getCompanyDmpSegmentId(linkedinApiClient, settings, validPayloads[0], statsContext, stateContext)
  } catch (err) {
    if (err instanceof RetryableError || err instanceof InvalidAuthenticationError || !isBatch) {

packages/destination-actions/src/destinations/linkedin-audiences/metadata.json:450

  • PR description states the action supports create-or-select via mapping-save hooks (retlOnMappingSave / onMappingSave), but the published action metadata shows \"hooks\": null (and the action definition shown doesn’t include hooks). If hooks are intended, they need to be wired in the action definition/metadata; otherwise the PR description should be updated to match the implementation.
      "hooks": null,

…s missing

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 6, 2026 09:30
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings August 6, 2026 10:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Suppressed comments (3)

packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/functions.ts:208

  • This throws a retryable error for HTTP 409 but reports it as status 429. That can misclassify conflicts as rate-limits (affecting retry/backoff logic, alerting, and observability) and makes debugging harder since the thrown status no longer matches the real response status. Prefer preserving the original status code (409) when constructing the RetryableError; if the RetryableError status type is restrictive, consider widening it (or casting) while still passing 409 through.
  if (status === 409) {
    throw new RetryableError(
      `Conflict while syncing to the LinkedIn DMP Company Segment. This event will be retried.${suffix}`,
      429
    )
  }

packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/functions.ts:304

  • The error message says "Company Audience", but the operation here is creating a LinkedIn DMP Company Segment. Updating this wording (e.g., "newly created DMP Company Segment") would make the error clearer and more consistent with the action/UI terminology.
    throw new IntegrationError(
      'LinkedIn did not return an id for the newly created Company Audience.',
      'CREATE_SEGMENT_FAILURE',
      500
    )

packages/destination-actions/src/destinations/linkedin-audiences/updateCompanyAudience/tests/snapshot.test.ts:50

  • expect(request.headers).toMatchSnapshot() is unreachable on the success path because the test returns immediately after snapshotting the parsed JSON. If headers are intended to be snapshotted, remove the early return and let the test also assert headers; if headers are not intended to be checked, remove the dead assertion and/or the surrounding comment/structure to avoid misleading future readers.
    try {
      const json = JSON.parse(rawBody)
      expect(json).toMatchSnapshot()
      return
    } catch (err) {
      expect(rawBody).toMatchSnapshot()
    }

    expect(request.headers).toMatchSnapshot()

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants