flxbl-io / sfp

A build system for modular development in Salesforce
https://docs.flxbl.io/sfp/
MIT License
30 stars 16 forks source link

Picklist update failure not caught during validation #32

Closed gvpalsson closed 8 months ago

gvpalsson commented 8 months ago

Describe the bug During the run of the validate command the error "Unable to process Picklist update due to URI malformed" is reported when processing the picklist update for one of our packages. The picklist processing terminates so all picklist fields left to be updated are not processed causing inconsistency in our orgs.

To Reproduce

  1. Include a picklist with the % character in its API name in a standard unlocked package.
  2. Run the sfp validate command to validate the package. Result: "Unable to process Picklist update due to URI malformed" error is reported in the validation output when that field is being processed by the picklist updater. A successful validation means this bad value will fail the picklist updater to update all picklists when the package is being deployed to orgs.

Expected behavior The sfp validate command should report a failed validation so the picklist updater will not break for package deployments.

Screenshots image

Platform Details (please complete the following information):

Additional context Add any other context about the problem here.

Rocko1204 commented 8 months ago

Hi @gvpalsson I have resolved this issue with fix #8 So its included in the release feb 24. Regards Ronny

michallachowski commented 8 months ago

@Rocko1204 After an update to v36.0.10 the issue still appears:

image

I did some research around it, and it looks like it happens because of % character in picklist API Name and / or label, which is not handled properly in PicklistEnabler.ts.

Here're changes that I tested already, and it seem to be handling % properly without using decodeURI(): https://github.com/flxbl-io/sfp/compare/main...michallachowski:sfp:picklist-enabler-decode-uri:

At this moment it looks to me like we could skip calls of decodeURIComponent() and decodeURI(), it doesn't seem to change anything (apart from the failure of processing other picklists) when % is in picklist name / label. However, please correct me if I'm wrong here.

michallachowski commented 7 months ago

@Rocko1204 @azlam-abdulsalam Kindly please let me know if you've any thoughts on this.