Lightning markup namespace lost after a refresh

Issue #706 resolved
Clay Li created an issue

Intellij 12.1.8 Illuminate cloud: Latest update Connection setting - official namespace, org namespace are set to the namespace in my org; application package is set to the managed package we're developing.

Access a lightning app, got error message:
org.auraframework.throwable.AuraRuntimeException: Error Retrieving Field for: v.customObj.namespace__field__c

Found the cause of the issue after debugging: - Namespace prefix in lightning markup was lost after "Refresh metadata...". Examples with "myns" as my namespace: A. Markup:

<aura:attribute name="myAttr1" type="myns__MyObj__c" default="{'sobjectType': 'myns__MyObj__c', 'myns__Source__c': 'Other'}" description="MyObj__c with myns namespace"/>

Saves to SFDC, go to developer console, verify the markup being saved properly. "Refresh metadata..." from SFDC, "myns" was removed, the markup changed to (both type and sobjectType lost the namespace prefix):

 <aura:attribute name="myAttr1" type="MyObj__c" default="{'sobjectType': 'MyObj__c', 'myns__Source__c': 'Other'}" description="MyObj__c with myns namespace"/>

Edit the component and save to SFDC. Check from the dev console, the markup is gone. Now, run the component from lightning experience, got the error above.

The same happened for event registration and handler. The same happened for component reference.

Am I missing some configuration in my setup? Please let me know if you need more info.

Comments (7)

  1. Scott Wells repo owner

    Clay, let me repeat back what I think is happening just to make sure I'm helping you toward the right resolution. So you're saying that if you have references like the the following locally in your Lightning markup:

    myns__MyObj__c
    

    and then you deploy it then immediately retrieve it, it's coming back as:

    MyObj__c
    

    without the namespace. Is that correct? If so, it might be easiest for us to get on a screenshare real quick to talk through the configuration. For what it's worth, I'm currently developing in exactly this model with Lightning and have it all working, so hopefully it's just a matter of changing some configuration and nothing that requires a new build of the plugin.

    Let me know, and also let me know if you're available for a quick screenshare so that we can get you to a quick resolution.

  2. Clay Li reporter

    Scott, I was not available this afternoon. Is it possible to do a screenshare now? I am available this evening or tomorrow morning. Thanks,Clay

  3. Scott Wells repo owner

    Clay, I'm unable to do it this evening as I have other obligations, but I might be able to do it tomorrow morning. What is your availability? And please include the time zone so I can see what might work for me. Thanks!

  4. Scott Wells repo owner

    Worked with Clay on this issue last night and it's actually Salesforce removing the namespace qualifications. We talked about when namespace qualifications are and aren't necessary, and of those that are, ways that IC can help using retrieval substitution rules to retain those that are incorrectly stripped by Salesforce on retrieval.

  5. Log in to comment