Skip to content

fix: Resolve JS proxy namespace mismatch for multi-segment company names#24877

Merged
ismcagdas merged 4 commits intodevfrom
fix/js-proxy-namespace-mismatch
Feb 16, 2026
Merged

fix: Resolve JS proxy namespace mismatch for multi-segment company names#24877
ismcagdas merged 4 commits intodevfrom
fix/js-proxy-namespace-mismatch

Conversation

@enisn
Copy link
Member

@enisn enisn commented Feb 16, 2026

Summary

When generating a project with a company name containing dots (e.g., Demo.App.QoL), the template replacement was incorrectly camelCasing the company name as demo.App instead of demo.app.

Root Cause

  • Template replacement (SolutionRenamer): Used ToCamelCase() on the entire company/project name string, which only lowercases the first character of the whole string.

    • "Demo.App".ToCamelCase()"demo.App"
  • Runtime proxy (JQueryProxyScriptGenerator.CamelCaseWithNamespace): Applies ToCamelCase() to each dot-separated segment individually.

    • "Demo.App""demo.app"

This mismatch causes a runtime error: Cannot read properties of undefined (reading 'someProperty') when the generated JavaScript tries to access a namespace that doesn't exist.

Fix

Added ToCamelCaseWithNamespace() helper method in SolutionRenamer.cs that mirrors the runtime proxy's behavior - splitting by . and camelCasing each segment.

Affected Areas

  • app-nolayers template (MVC, Blazor, etc.)
  • app template (Web, Web.Host)
  • microservice templates
  • Any template using dynamic JS proxies with the .services. or .controllers. pattern

Files Changed

  • framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/SolutionRenamer.cs

When generating a project with a company name containing dots (e.g.,
'Demo.App.QoL'), the template replacement was incorrectly camelCasing
the company name as 'demo.App' instead of 'demo.app'.

This was because SolutionRenamer used ToCamelCase() on the entire string
rather than on each dot-separated segment individually. The runtime JS
proxy generator (JQueryProxyScriptGenerator.CamelCaseWithNamespace) applies
camelCase to each segment, causing a mismatch.

Added ToCamelCaseWithNamespace() helper to match runtime behavior.
Copilot AI review requested due to automatic review settings February 16, 2026 09:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical bug where projects with multi-segment company names (e.g., Demo.App.QoL) caused runtime JavaScript errors due to namespace mismatches between template generation and runtime proxy script generation.

Changes:

  • Added ToCamelCaseWithNamespace() helper method that transforms each dot-separated segment individually (e.g., "Demo.App" → "demo.app")
  • Updated template replacement logic to use the new method for both company name and project name transformations
  • Added System.Linq import for the Select() method used in the new helper

Comment on lines +65 to +73
private static string ToCamelCaseWithNamespace(string name)
{
if (name.Contains('.'))
{
return name.Split('.').Select(n => n.ToCamelCase()).JoinAsString(".");
}

return name.ToCamelCase();
}
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding unit tests for the new ToCamelCaseWithNamespace method to verify it correctly handles multi-segment namespaces (e.g., "Demo.App.QoL" → "demo.app.qoL"). This would prevent regressions and document the expected behavior. The test could be added to a new SolutionRenamer_Tests class in the Volo.Abp.Cli.Core.Tests project, following the pattern of other test classes in that project.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Copy link
Contributor

Copilot AI commented Feb 16, 2026

@enisn I've opened a new pull request, #24878, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits February 16, 2026 10:12
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ enisn
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@ismcagdas ismcagdas merged commit 9a363d3 into dev Feb 16, 2026
2 of 3 checks passed
@ismcagdas ismcagdas deleted the fix/js-proxy-namespace-mismatch branch February 16, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants