Null pointer error thrown from SOQL on MessagingSession AgentMessageCount and EndUserMessageCount without perm
Trailblazer Community

Null pointer error thrown from SOQL on MessagingSession AgentMessageCount and EndUserMessageCount without perm

Last updated 2021-07-20 ·Reference W-9094300 ·Reported By 11 users

Fixed - Summer '21 Patch 13.0

Summary
An issue has been identified where the SOQL for AgentMessageCount and EndUserMessageCount fields will result in a component gack if the Access Conversation Entries permission is removed from the user profile accessing these fields. This started in Summer 21, previously the data for these fields would still load even if the user did not have the assigned permission.

Repro
1) Assign the AgentMessageCount and EndUserMessageCount fields to the MessagingSession page layout

2) Edit the user profile to disable Access Conversation Entries

3) Ensure that the permission set assigned to the user also does not have Access Conversation Entries enabled

4) Access a Messaging Session record and view the details component

5) Observe that the component shows an internal error rather than loading field data.

OR

Issue can also be reproduced by running below SOQL query:

SELECT AcceptTime,AgentMessageCount,AgentType,CaseId,ChannelEndUserFormula,ChannelGroup,ChannelIntent,ChannelKey,ChannelLocale,ChannelName,ChannelType,CreatedById,CreatedDate,EndTime,EndUserAccountId,EndUserContactId,EndUserMessageCount,Id,IsDeleted,LastModifiedById,LastModifiedDate,LastReferencedDate,LastViewedDate,LeadId,MessagingChannelId FROM MessagingSession

Workaround
Please enable the perm "Access Conversation Entries" under Administrative Permission.

Summer 21 release doc:

https://dreamevent.secure.force.com/articleView?id=release-notes.rn_messaginng_conversation_entries.htm&type=5&release=232

Updates
Bug is logged to ensure the component or SOQL query is loaded successfully without any data in the fields "AgentMessageCount" & "EndUserMessageCount" if perm "Access Conversation Entries" is disabled.

Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.