New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Case-folding of "ProductCode" field #2558
Comments
I can't read C++ but in the spirit of Hacktoberfest I tried to look into this. I've found what I think are two possible sources of this problem, depending on what is called by what when: First, this comment and code in WorkflowBase.cpp seems to imply ProductCodes are intentionally always searched "Exact": winget-cli/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp Lines 472 to 477 in 8d0996f
and then further down the same file we have some more interesting logic that always searches for ProductCodes with MatchType "Exact", but does make an exception for portable packages specifically and treats those correctly with CaseInsensitive: winget-cli/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp Lines 1073 to 1081 in 8d0996f
Then there's also some sussy stuff in ARPCorrelation.cpp, but to me it reads like these searches are only comparing the current ARP state to a cached/prior ARP state so maybe this code doesn't actually interact with a remote source: winget-cli/src/AppInstallerRepositoryCore/ARPCorrelation.cpp Lines 193 to 223 in 8d0996f
If the issue really is in WorkflowBase.cpp where I pointed to I could open a PR, but my C++ skills won't go much beyond replacing |
@ryfu-msft the origin of this came from winget-cli-restsource. Does this look like it's sufficient, or would more work be involved (test cases impacted)? |
Is there an update on this? |
Brief description of your issue
The client calls a REST source and passes in the productCode in lowercase. It's doing "Exact" matching when it probably should be doing "caseInsesnsitive" as referenced in:
Steps to reproduce
Add a manifest with a product code containing an upper case productCode to the REST source.
Attempt to get a matching result with the client.
Expected behavior
A match is returned
Actual behavior
No match is returned.
Environment
The text was updated successfully, but these errors were encountered: