Skip to content

STRATCONN-6441 - [Facebook CAPI] - removing flags from actions#3756

Open
joe-ayoub-segment wants to merge 10 commits into
mainfrom
fb-refactor-remove-flags
Open

STRATCONN-6441 - [Facebook CAPI] - removing flags from actions#3756
joe-ayoub-segment wants to merge 10 commits into
mainfrom
fb-refactor-remove-flags

Conversation

@joe-ayoub-segment
Copy link
Copy Markdown
Contributor

@joe-ayoub-segment joe-ayoub-segment commented Apr 27, 2026

Removing flags after Facebook CAPI refactor.

Removes feature flags from the Facebook Conversions API destination actions. Previously, each action had two code paths — a legacy inline implementation and a newer shared send() function gated behind a feature flag. Since all flags have been fully rolled out, this PR removes the flag checks and legacy code paths, making the shared send() function the single implementation for all actions. Also cleans up redundant files (constants.ts, utils.ts, fb-capi-* modules) whose functionality has been consolidated into shared/constants.ts and shared/functions.ts.

export const FEATURE_FLAG_ADD_TO_CART = 'FB_CAPI_REFACTOR_ADD_TO_CART_EVENT'
image

export const FEATURE_FLAG_CUSTOM = 'FB_CAPI_REFACTOR_CUSTOM_EVENT'
image

export const FEATURE_FLAG_INITIATE_CHECKOUT = 'FB_CAPI_REFACTOR_INITIATE_CHECKOUT_EVENT'
image

export const FEATURE_FLAG_PAGE_VIEW = 'FB_CAPI_REFACTOR_PAGE_VIEW_EVENT'
image

export const FEATURE_FLAG_PURCHASE = 'FB_CAPI_REFACTOR_PURCHASE_EVENT'
image

export const FEATURE_FLAG_SEARCH = 'FB_CAPI_REFACTOR_SEARCH_EVENT'
image

export const FEATURE_FLAG_VIEW_CONTENT = 'FB_CAPI_REFACTOR_VIEW_CONTENT_EVENT'
image

Testing

Deployed to staging for sanity check.

Security Review

Please ensure sensitive data is properly protected in your integration.

  • Reviewed all field definitions for sensitive data (API keys, tokens, passwords, client secrets) and confirmed they use type: 'password'

New Destination Checklist

  • Extracted all action API versions to verioning-info.ts file. example

Copilot AI review requested due to automatic review settings April 27, 2026 15:42
@joe-ayoub-segment joe-ayoub-segment requested a review from a team as a code owner April 27, 2026 15:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes per-action feature-flag branching and legacy, duplicated request/validation logic in the Facebook Conversions API destination actions, consolidating behavior around the shared send() helper.

Changes:

  • Removed FEATURE_FLAG_* gating branches from multiple Facebook CAPI actions and routed execution through the shared send() path.
  • Deleted legacy helper modules (fb-capi-user-data.ts, fb-capi-properties.ts, fb-capi-app-data.ts) that previously contained validation/hashing/app-data logic.
  • Simplified action implementations by trimming imports and deferring validation/request construction to shared helpers.

Reviewed changes

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

Show a summary per file
File Description
packages/destination-actions/src/destinations/facebook-conversions-api/viewContent2/index.ts Removes feature-flag branching; always uses shared send() for V2 ViewContent.
packages/destination-actions/src/destinations/facebook-conversions-api/viewContent/index.ts Removes legacy inline implementation; always uses shared send().
packages/destination-actions/src/destinations/facebook-conversions-api/search2/index.ts Removes feature-flag branching; always uses shared send() for V2 Search.
packages/destination-actions/src/destinations/facebook-conversions-api/search/index.ts Removes legacy inline implementation; always uses shared send().
packages/destination-actions/src/destinations/facebook-conversions-api/purchase2/index.ts Removes feature-flag branching; always uses shared send() for V2 Purchase.
packages/destination-actions/src/destinations/facebook-conversions-api/purchase/index.ts Removes legacy inline implementation; always uses shared send().
packages/destination-actions/src/destinations/facebook-conversions-api/pageView2/index.ts Removes feature-flag branching; always uses shared send() for V2 PageView.
packages/destination-actions/src/destinations/facebook-conversions-api/pageView/index.ts Removes legacy inline implementation; always uses shared send().
packages/destination-actions/src/destinations/facebook-conversions-api/initiateCheckout2/index.ts Removes feature-flag branching; always uses shared send() for V2 InitiateCheckout.
packages/destination-actions/src/destinations/facebook-conversions-api/initiateCheckout/index.ts Removes legacy inline implementation; always uses shared send().
packages/destination-actions/src/destinations/facebook-conversions-api/custom2/index.ts Removes feature-flag branching; always uses shared send() for V2 Custom.
packages/destination-actions/src/destinations/facebook-conversions-api/custom/index.ts Removes legacy inline implementation; always uses shared send().
packages/destination-actions/src/destinations/facebook-conversions-api/addToCart2/index.ts Removes feature-flag branching; always uses shared send() for V2 AddToCart.
packages/destination-actions/src/destinations/facebook-conversions-api/addToCart/index.ts Removes legacy inline implementation; always uses shared send().
packages/destination-actions/src/destinations/facebook-conversions-api/fb-capi-user-data.ts Deletes legacy user-data normalization/hashing module.
packages/destination-actions/src/destinations/facebook-conversions-api/fb-capi-properties.ts Deletes legacy shared field definitions + contents/DP options helpers.
packages/destination-actions/src/destinations/facebook-conversions-api/fb-capi-app-data.ts Deletes legacy app-data generation + field definition module.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.95%. Comparing base (6601116) to head (17549eb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3756      +/-   ##
==========================================
+ Coverage   80.93%   80.95%   +0.02%     
==========================================
  Files        1348     1343       -5     
  Lines       25089    24719     -370     
  Branches     5212     5073     -139     
==========================================
- Hits        20305    20012     -293     
+ Misses       3837     3781      -56     
+ Partials      947      926      -21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI review requested due to automatic review settings May 6, 2026 08:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 33 out of 33 changed files in this pull request and generated 3 comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 37 out of 37 changed files in this pull request and generated 5 comments.

Comment thread packages/destination-actions/src/destinations/facebook-conversions-api/utils.ts Outdated
Copilot AI review requested due to automatic review settings May 6, 2026 08:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 39 out of 39 changed files in this pull request and generated 2 comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 39 out of 39 changed files in this pull request and generated 4 comments.

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.

3 participants