Skip to content

Interactions rows for different people have the same InteractionSessionId #6641

@stanalyst

Description

@stanalyst

Description

It is our understanding that an InteractionSession row should only be related to Interaction rows for one distinct person - not multiple people. We have discovered in our database that this is not always the case. In fact out of 16,566,269 total InteractionSession rows - 4,912 of these have more than 1 person's interactions related to them. I realize this is less than 1% - but shouldn't this be 0%?

Here is the SQL I used to find the rows:

SELECT  s.[Id] AS 'InteractionSessionId'
        , ic.[Name] AS 'InteractionChannel'
        , ic.[ChannelTypeMediumValueId] AS 'ChannelMedium'
        , s.[CreatedDateTime] AS 'SessionCreatedDate'
        , s.[DurationSeconds] AS 'SessionDurationSeconds'
        , COUNT(DISTINCT pa.[PersonId]) AS 'DistinctPersonCount'
FROM    [InteractionSession] s
INNER JOIN  [Interaction] i
    ON  s.[Id] = i.[InteractionSessionId]
INNER JOIN  [PersonAlias] pa
    ON  i.[PersonAliasId] = pa.[Id]
INNER JOIN  [Person] p
    ON  p.[Id] = pa.[PersonId]
    AND p.[RecordTypeValueId] = 1
LEFT OUTER JOIN [InteractionChannel] ic
    ON  ic.[Id] = s.[InteractionChannelId]
GROUP BY s.Id
        , ic.[Name]
        , ic.[ChannelTypeMediumValueId]
        , s.CreatedDateTime
        , s.[DurationSeconds]
HAVING  COUNT(DISTINCT pa.[PersonId]) > 1
ORDER BY 'DistinctPersonCount' desc
        , s.[Id];

I also posted about this in the Troubleshooting and Rock-Stars channels. So far 2 other rock-stars have found similar results when they run this SQL on their databases. I also ran this on the prealpha site - and found 3 rows. I did not find any rows on the demo site - but I'm guessing that's because it is reset too frequently.

Actual Behavior

We have over 4000 InteractionSession rows that related to Interactions for more than 1 person.

Expected Behavior

I would expect that all of the Interaction rows related to a single InteractionSession are for the same individual person - NOT for multiple people. Unless we just really don't understand how these sessions are supposed to work.

Steps to Reproduce

I don't know - but RUN the above SQL on prealpha and you should see those rows. And based on our results and the results from the other churches - there does seem to be a correlation between total Sessions and how many have multiple people.

Issue Confirmation

  • Perform a search on the Github Issues to see if your bug is already reported.
  • Reproduced the problem on a fresh install or on the demo site.

Rock Version

17.6.1 and PreAlpha

Client Culture Setting

en-US

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions