Skip to content

fix: unhandled error code in facebook_custom_audience - #2853

Merged
sanpj2292 merged 1 commit into
developfrom
fix.fb_custom_aud-unhandled-stcode
Nov 28, 2023
Merged

sanpj2292 merged 1 commit into
developfrom
fix.fb_custom_aud-unhandled-stcode

Conversation

@sanpj2292

@sanpj2292 sanpj2292 commented Nov 28, 2023 •

Copy link
Copy Markdown

Description of the change

The error code 200 has not been handled properly in facebook_custom_audience destination. We have seen it being retried and getting aborted after retries are complete. Since this is a permissions issue, ideally it should be aborted.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Resolves INT-1086

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

Summary by CodeRabbit

  • Bug Fixes

    • Improved error handling with a new default error message for unauthorized access attempts.
    • Standardized quotation marks in HTTP headers for consistency.
  • Tests

    • Updated integration test data to reflect new HTTP status codes and response body content.
    • Enhanced network test scenarios with additional request and response configurations.

@sanpj2292 sanpj2292 self-assigned this Nov 28, 2023
@sanpj2292
sanpj2292 requested review from a team and sivashanmukh as code owners November 28, 2023 07:14
@sanpj2292
sanpj2292 requested review from a team, Gauravudia and anantjain45823 November 28, 2023 07:14
@coderabbitai

coderabbitai Bot commented Nov 28, 2023 •

Copy link
Copy Markdown
Contributor

Walkthrough

The changes involve updates to error handling, request and response data structures, and network call configurations for a Facebook utility and associated tests. A new error code mapping is introduced, request headers are standardized, and response bodies are expanded with detailed status and message properties. These modifications aim to enhance the robustness and clarity of interactions with Facebook's API for custom audience data delivery.

Changes

File Path Change Summary
src/v0/.../networkHandler.js Added a new error code entry with status 200 and default error details.
test/integrations/.../data.ts Updated request headers to use single quotes and expanded output objects with status and detailed properties.
test/integrations/.../network.ts Modified network call data with new request and response configurations, including endpoint, headers, params, and status details.

Assessment against linked issues

Objective Addressed Explanation
Checking in latest GATransform artifacts under dipanjan branch of rud… (#1) ❌ The provided summary does not mention GATransform artifacts or the merging of any branches, which suggests that the objective related to checking in GATransform artifacts has not been addressed in the provided changes.

Poem

In the code where bugs once hopped, 🐛
A rabbit's work has made them stopped. 🐇💻
With quotes aligned and errors mapped,
Our Facebook calls are now aptly wrapped. 🎁✨


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@coderabbitai coderabbitai Bot 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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9eda50e and ea40d97.
Files selected for processing (3)
  • src/v0/util/facebookUtils/networkHandler.js (1 hunks)
  • test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts (1 hunks)
  • test/integrations/destinations/fb_custom_audience/network.ts (1 hunks)
Additional comments: 4
src/v0/util/facebookUtils/networkHandler.js (2)
  • 198-199: The addition of status code 200 to handle it as a permissions issue with a default status of 403 seems appropriate given the context provided. Ensure that this new error handling logic is consistent with the rest of the application's error handling strategy.

  • 203-203: Ensure that the function getErrorDetailsFromErrorMap is tested with the new error code 200 to verify that it correctly retrieves the error details as expected.

test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts (1)
  • 1-572: The changes in the test data are consistent with the PR's intent to handle status code 200 as a permissions issue and to update the test cases accordingly. The use of single quotes for the keys in the headers property and the addition of the status property in the output object are also in line with the changes described in the summary.
test/integrations/destinations/fb_custom_audience/network.ts (1)
  • 1-480: The changes to the networkCallsData array, including the updates to the httpReq and httpRes objects, appear to be consistent and align with the PR's aim to handle error code 200 as a permissions issue. The test cases seem to cover the new error handling logic appropriately.

@codecov

codecov Bot commented Nov 28, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9eda50e) 87.16% compared to head (ea40d97) 87.16%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2853   +/-   ##
========================================
  Coverage    87.16%   87.16%           
========================================
  Files          772      772           
  Lines        28788    28788           
  Branches      6764     6764           
========================================
  Hits         25094    25094           
  Misses        3351     3351           
  Partials       343      343           

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

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sanpj2292
sanpj2292 requested a review from koladilip November 28, 2023 09:12
@sanpj2292
sanpj2292 merged commit 8c02b8c into develop Nov 28, 2023
@sanpj2292
sanpj2292 deleted the fix.fb_custom_aud-unhandled-stcode branch November 28, 2023 09:36
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.

3 participants