fivetran / dbt_intercom

Data models for Fivetran's Intercom connector built using dbt.
https://fivetran.github.io/dbt_intercom/
Apache License 2.0
4 stars 6 forks source link

[Bug] first_admin_response_at can be grouped under "part_type= 'assignment'" #35

Closed TrangNgo closed 1 year ago

TrangNgo commented 1 year ago

Is there an existing issue for this?

Describe the issue

Hi team, I'm opening an issue on behalf of the customer.

This is related to the issue posted here, where we are grabbing the 2nd admin comment as the "first admin response": https://community.fivetran.com/t5/working-with-data/inconsistency-with-intercom-dbt-data/td-p/642

Intercom support has confirmed that the first admin comment can be grouped under part_type=assignment:

On the issue of how the Fivetran integration analyzes Intercom data from admin replies in conversations:

It looks like the issue is around an admin reply being coupled under "assignment" when they occur at the same time, is that correct? And therefore the conversation part type is "assignment", rather than "comment".

Looking at this conversation: https://app.intercom.com/a/apps/urub4jwk/conversations/7758

The admin Jesus's first reply is grouped with an "assignment" at 2023-01-26 17:10:48 UTC. Then 2nd reply from Jesus is at 2023-01-26 17:23:15 UTC and it is a part type "comment".

This is because, when conversations are self assigned from an admin reply, the first reply will be grouped under "assignment" image In the Conversation Model / Object it would look like this image Then subsequent admin replies would be a "comment" image So if Fivetran is ignoring a reply in the "body" section of the "assignment" part type, they would need to address this on their end, as this is the expected behavior in Intercom of how this data is grouped

Relevant error log or model output

No response

Expected behavior

For the first_admin_response_at, we also need to check if the first admin response is coming through as part_type=assignment.

dbt Project configurations

n/a

Package versions

n/a

What database are you using dbt with?

snowflake

dbt Version

n/a

Additional Context

This is related to the issue posted here, where we are grabbing the 2nd admin comment as the "first admin response": https://community.fivetran.com/t5/working-with-data/inconsistency-with-intercom-dbt-data/td-p/642

Are you willing to open a PR to help address this issue?

fivetran-joemarkiewicz commented 1 year ago

Thanks so much for opening this issue @TrangNgo and for helping us isolate the issue!

I believe I found the fix (with the help of your call out) and currently have an open PR that should address the original issue. Essentially, I adjusted the admin_response_at metrics to take into account assignment part_types if the body of the message is not null. This should resolve the initial error. If you wish, you can test the changes by using the version of the package in your packages.yml.

packages:
  - git: https://github.com/fivetran/dbt_intercom.git
    revision: bugfix/first-admin-response
    warn-unpinned: false 
fivetran-joemarkiewicz commented 1 year ago

Closing this issue as the above mentioned PRs have been merged and is live within the v0.6.1 version of the package.

Please feel free to reopen if the issue persists on your end.