amazon-connect / amazon-connect-salesforce-cti

Documentation for Amazon Connect CTI Adapter for Salesforce.
https://amazon-connect.github.io/amazon-connect-salesforce-cti/
Other
43 stars 37 forks source link

SOQL Exception from Trigger in AC CTI package #135

Open rudik99 opened 2 years ago

rudik99 commented 2 years ago

Hi, I'm not sure if this is the right place to raise this, so let me know otherwise.

Our TAM from Salesforce spotted this exception in our Org and it was occurring very frequently. It is coming from a trigger that appears to be managed by the Amazon Connect CTI adapter package.

  1. Error Exception in SOQL : "System.QueryException: Non-selective query against large object type"
  2. Count of occurrences till present : ~ 60636 Total. Trending at ~ 9000 per day.
  3. Entrypoint of Error : Managed Package Component - "amazonconnect.AC_VoiceIdChannelTrigger"
  4. Failing Query: "SELECT Id, Phone, MobilePhone FROM Contact WHERE Phone = :phoneNumsContactSet OR MobilePhone = :phoneNumsContactSet"

The above query was trying to retrieve more than 1000000 rows as an inefficient transaction.

Please refer to this article for more info - https://help.salesforce.com/s/articleView?id=000323572&type=1

EDIT: running 5.18

CaseyGraves commented 2 years ago

We're on v5.11 and are running into the same type of error when users make changes to Contact records. Unfortunately the version we're on does not allow for disabling the trigger (newer versions have an option to disable/enable a few of the AC managed triggers) so our only recourse was to archive records externally then delete them in SF to get below the count that flags the query as non-selective.

Currently working on seeing if we can update to a new version so that we at least have the option to disable the trigger but am having issues with the Contact Lens recording player with the latest version (open issue here in GitHub on that one).

Long term seems like a deeper fix is needed as turning the trigger off is not really a solve and you lose functionality if you have an org that generates a decent amount of phone call data.