Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Customer.io destination with new mapping #2111

Merged
merged 4 commits into from
Jul 9, 2024

Conversation

sydneycollins-cio
Copy link
Contributor

@sydneycollins-cio sydneycollins-cio commented Jun 25, 2024

Updates the Customer.io destination:

Updated destinations

createUpdateObject
deleteDevice
deleteObject
deleteRelationship

Testing

Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [Segmenters] Tested in the staging environment

@@ -13,7 +13,7 @@ const action: ActionDefinition<Settings, Payload> = {
description: 'An object ID used to identify an object.',
type: 'string',
default: {
'@path': '$.context.groupId'
'@path': '$.groupId'
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @sydneycollins-cio - would it not make sense to do this following?

Suggested change
'@path': '$.groupId'
'@path': '$.properties.objectId'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does make sense, I have updated this

Comment on lines 121 to 122
delete (custom_attributes as { traits?: { object_type_id?: unknown } })?.traits?.object_type_id
delete (custom_attributes as { traits?: { relationshipAttributes?: unknown } })?.traits?.relationshipAttributes
Copy link
Contributor

Choose a reason for hiding this comment

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

hi @sydneycollins-cio - can you explain what's supposed to be happening here, and how it differs from these lines ?

delete custom_attributes?.object_type_id
 delete custom_attributes?.relationshipAttributes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea is to remove these values from the object regardless inside traits or on the custom_attributes as our api is not going to use these values

Comment on lines 148 to 149
delete (custom_attributes as { traits?: { object_type_id?: unknown } })?.traits?.object_type_id
delete (custom_attributes as { traits?: { relationshipAttributes?: unknown } })?.traits?.relationshipAttributes
Copy link
Contributor

Choose a reason for hiding this comment

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

hi @sydneycollins-cio can you explain what these lines are attempting to do please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea is to remove these values from the object regardless inside traits or on the custom_attributes as our api is not going to use these values

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @sydneycollins-cio thanks for clarifying.

I'm not sure this is going to work, however the code shouldn't cause any issues so it is OK to deploy.

delete (custom_attributes as { traits?: { object_type_id?: unknown } })?.traits?.object_type_id
will attempt to delete this attribute:
custom_attributes.traits.object_type_id

However I can't see how custom_attributes will ever contain the traits object.

Either way, I'm ok to deploy this - you can amend / fix if it doesn't work as you need.

@joe-ayoub-segment joe-ayoub-segment merged commit a80bd99 into segmentio:main Jul 9, 2024
10 of 11 checks passed
@joe-ayoub-segment
Copy link
Contributor

hi @sydneycollins-cio this PR has been deployed. Can you please confirm that you are happy with the change?

@sydneycollins-cio
Copy link
Contributor Author

hi @sydneycollins-cio this PR has been deployed. Can you please confirm that you are happy with the change?

It looks great! thanks so much 🙏🏽

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