SalesforceCommerceCloud / b2c-crm-sync

... a contemporary perspective on how to integrate B2C Commerce and the Salesforce Customer 360 Platform to power frictionless customer experiences in the B2C domain.
https://salesforcecommercecloud.github.io/b2c-crm-sync/
BSD 3-Clause "New" or "Revised" License
65 stars 45 forks source link

[BUG] ...Error Occurred During Flow "B2C Commerce: Platform Event: Process Contact Update" #181

Closed ishaanmotwani closed 1 year ago

ishaanmotwani commented 2 years ago

Describe the bug Error element ia_persistAndAuditB2CAuthToken (FlowActionCall). An Apex error occurred: System.DmlException: Insert failed. First exception on row 0; first error: STRING_TOO_LONG, B2C AuthToken: data value too large: <a large access token which is definitely greater than 80 characters> (max length=80): [Name]

Flow Details Flow API Name: B2CCommerce_PlatformEvent_ProcessContactUpdate Type: Autolaunched Flow

To Reproduce Steps to reproduce the behavior:

  1. Whenever a new customer is created in SFCC and it gets syncs to SFOMS, we get the above error
  2. When we deep dived, it seems that the class "B2CIAPersistB2CAuthToken" is trying to insert records of B2C_AuthToken__c object and while doing so is storing the access token in the standard name field, which is limited to 80 characters.

Expected behavior Since the token size is usually more than 80 characters, I would expect to store this in another field like a text area field

Your local environment details:

Your remote environment details:

orvischoinierec commented 2 years ago

I think you need to change the token type for the API in B2C Commerce Account Manager to UUID. JWT will exceed the field length