Skip to content

fix(domains): prioritize custom domains over free subdomains on isPrimary ties (#719) - #723

Open
chbndrhnns wants to merge 1 commit into
oblien:mainfrom
chbndrhnns:fix/route-normalization-domain-type-tiebreaker
Open

fix(domains): prioritize custom domains over free subdomains on isPrimary ties (#719)#723
chbndrhnns wants to merge 1 commit into
oblien:mainfrom
chbndrhnns:fix/route-normalization-domain-type-tiebreaker

Conversation

@chbndrhnns

Copy link
Copy Markdown
Contributor

Closes #719

Changes

  • In apps/api/src/modules/domains/project-route.service.ts (normalizeProjectRouteRows) and apps/api/src/lib/public-endpoints.ts (routeRowsToPublicEndpoints & serviceDomainRowsToPublicEndpoints), added a domain-type tiebreaker (left.domainType === 'custom' ? -1 : 1) before falling back to alphabetical hostname comparison on isPrimary ties.
  • Added unit test in apps/api/test/modules/domains/project-route.service.test.ts verifying that deriveProjectRouteState resolves primaryDomainType = 'custom' and selects the custom domain when both free and custom domains have matching isPrimary status.
  • Added unit test in apps/api/test/lib/public-endpoints.test.ts verifying endpoint sorting with equal isPrimary status.

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.

[Bug] normalizeProjectRouteRows sorts free .opsh.io subdomains ahead of custom domains on isPrimary ties

1 participant