Skip to content

fix(intercom): group call - #2484

Merged
krishna2020 merged 4 commits into
developfrom
fix/intercom-group-call
Aug 18, 2023
Merged

krishna2020 merged 4 commits into
developfrom
fix/intercom-group-call

Conversation

@Gauravudia

Copy link
Copy Markdown
Contributor

Description of the change

Resolves INT-374

  • Remove user_id parameter from the create/update company payload. Since, this parameter is not supported by Intercom
  • Pass anonymousId as user_id to attach the created company to a user in Intercom

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

Fix #1

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

@Gauravudia Gauravudia self-assigned this Aug 14, 2023
@Gauravudia
Gauravudia requested review from a team as code owners August 14, 2023 17:58
@linear

linear Bot commented Aug 14, 2023

Copy link
Copy Markdown
INT-374 Intercom: Group call fix by passing right userId

Intercom /companies API does not support user_id parameter. But here we sending the user_id = anonymousId in payload when Send Anonymous Id toggle is enabled and userId is not available. Intercom is returning the below response for this case

{
  "response": "{\"type\":\"error.list\",\"request_id\":null,\"errors\":[{\"code\":\"bad_request\",\"message\":\"bad 'user_id' parameter\"}]}",
  "firstAttemptedAt": "2023-08-14T17:24:24.096Z",
  "content-type": "application/json; charset=utf-8"
}

Fix

  • We need to remove sending user_id parameter for Group call (for create/update company).
  • Since, We already have a support of sending anonymousId as a secondary userId when userId is not available and Send AnonymousId toggle is enabled on webapp. We can use anonymousId in the Group call to link Company with the user in Intercom.

Test Report

https://www.notion.so/rudderstacks/Test-Results-844208c964bf4dd797bd15c99e1049dc

@codecov

codecov Bot commented Aug 14, 2023 •

Copy link
Copy Markdown

Codecov Report

Patch coverage: 94.09% and project coverage change: -0.03% ⚠️

Comparison is base (a975eeb) 86.67% compared to head (4feda50) 86.64%.
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2484      +/-   ##
===========================================
- Coverage    86.67%   86.64%   -0.03%     
===========================================
  Files          563      563              
  Lines        27882    27914      +32     
  Branches      6674     6660      -14     
===========================================
+ Hits         24167    24187      +20     
- Misses        3362     3374      +12     
  Partials       353      353              
Files Changed Coverage Δ
src/v0/destinations/iterable/transform.js 95.41% <92.98%> (-1.48%) ⬇️
src/v0/destinations/iterable/util.js 94.42% <93.99%> (-4.33%) ⬇️
src/controllers/destination.ts 84.52% <100.00%> (ø)
src/services/destination/nativeIntegration.ts 88.88% <100.00%> (+0.13%) ⬆️
src/v0/destinations/intercom/transform.js 96.52% <100.00%> (+0.12%) ⬆️
src/v0/destinations/iterable/config.js 100.00% <100.00%> (ø)

☔ 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

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@anantjain45823 anantjain45823 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.

lookout for codecov coverage failure.

@krishna2020
krishna2020 merged commit 1f9bda7 into develop Aug 18, 2023
@devops-github-rudderstack
devops-github-rudderstack deleted the fix/intercom-group-call branch November 19, 2023 01:28
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.

4 participants