7

We have a managed package with lightning components that is behaving as expected in a vast majority of orgs. However, in a select few production orgs one of our components fails to render. Upon inspecting the component tree, I am seeing {!v.record.NS__MyField__c} replaced with {!v.record.unknown_custom_field}. This is not a permissions issue since the user in question has access to the record, object, and field and this does not occur in the customer's sandbox. The API version of the packaged component is 33.0.

Has anyone seen this behavior before or know under what scenario this replacement would happen?

Edit for behavior clarification

It is not the case the every expression with this custom field is being replaced. Only some (and then it displays fine in other places).

Edit for package setup

To clarify, all components in question are in the same managed package. This package is installed in a number of developer, sandbox, and production orgs. The package previously worked in the production orgs in question but at some point this behavior started showing. The time at which the behavior started showing was not around the time of a Salesforce major release or a package update.

Edit for timeline

This issue went away for a while but is now back which leads me to the conclusion that this is not an issue related to a specific Salesforce release. This first appeared in Summer 17 and is still present in Winter 18.

  • Is the component in a different namespace thanNS? If so, then is the NS package missing or is a license not allocated to the User that you are using to install the component package? – Keith C Sep 13 '17 at 2:59
  • The baffling thing is that this is all part of the same managed package. It is simply behaving differently in different orgs. – dsharrison Sep 13 '17 at 3:00
  • Yep pretty weird. Patch rollouts or Winter '18 in some orgs? – Keith C Sep 13 '17 at 3:12
  • I am not sure how to check the patch version of an org but they are certainly on Summer 17 still. – dsharrison Sep 13 '17 at 3:15
  • 2
    Seeing this exact same thing. – wellmstein Sep 25 '17 at 14:42
2

Salesforce has confirmed this is an issue with the Lightning framework but will not be creating a known issue at this time. Here is the description of the issue and the workaround as given to us by their R&D team:

The framework caches component definitions and other metadata information at the organization level to improve component load times. However, when there is a large volume of transactions on an organization's instance, this cache can drop important information about a component. This then causes the component to load incorrectly (in this case it doesn't have the important field metadata so it says "unknown_custom_field" in place of the actual field api name). The only way to fix the component at this point is to change the markup and re-deploy the component so that the cache sees that the component definition has changed and is rebuilt. This can be done by adding a comment with a timestamp to the component.

As a managed package provider this is incredibly inconvenient as it requires us to issue patch releases for specific customers to simply change a comment and force a cache rebuild in their org. If someone from Salesforce sees this we would really appreciate a known issue to point our customers to.

  • I don't suppose it helps if those specific customers disable the option "Enable secure and persistent browser caching to improve performance"? – Charles T Dec 21 '17 at 2:03
  • We've just been having this problem in a lightning community and Salesforce have advised to change the lightning attribute to an Object instead of either a specific sObject or just sObject. – Paul Kissick Oct 24 '18 at 10:51
0

Is it a relationship? I was having the same issue in our environment with a lookup field. The user did not have read access to the child object. Once we gave Read access on that object, the issue was resolved.

  • It is a formula field (number). – dsharrison Oct 6 '17 at 19:54
0

I have a hunch that the new update in Winter'19 which introduced the CDN setting to "load components faster" is probably a fix for these issues. Basically your components metadata will be loaded from some other service. You should try enabling the CDN setting and see does this problem occur again.

https://releasenotes.docs.salesforce.com/en-us/winter19/release-notes/rn_lc_cdn.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.