Bug Report
Problem
Editing any existing Kubero app in the UI shows a "domain already taken" error and the Save button is disabled, even though the domain belongs to the app being edited.
Root Cause
Race condition in client/src/components/apps/form.vue. In mounted(), getDomains() and loadPipelineAndApp() run concurrently via Promise.all. Inside loadPipelineAndApp(), loadApp() is called but not awaited, so getDomains() resolves first. When it calls whiteListDomains(), this.ingress.hosts is still empty — the app's own domain is never excluded from takenDomains. The backend enforces no domain uniqueness; this is purely a frontend bug.
This was introduced in PR #265 (v2.0.0, Jan 2024).
Additionally, whiteListDomains() has a splice index bug that makes it unreliable even when called in the correct order (mutating an array while iterating by index).
Steps to Reproduce
- Create an app with a custom domain
- Navigate to the app edit page
- Observe: the domain field shows "already taken" and Save is disabled
Fix
1. Make loadApp() async:
async loadApp() {
if (this.app !== "new") {
return axios.get(`/api/apps/${this.pipeline}/${this.phase}/${this.app}`)
.then((response) => {
// populate this.ingress — whiteListDomains call removed
});
}
},
2. Await loadApp() inside loadPipelineAndApp():
if (this.app != "new") {
await this.loadApp();
}
3. Fix whiteListDomains() splice bug:
whiteListDomains(domainsList: string[]) {
const ownHosts = new Set(this.ingress.hosts.map((h) => h.host));
return domainsList.filter((d) => !ownHosts.has(d));
},
I will submit a PR with these fixes shortly.
Bug Report
Problem
Editing any existing Kubero app in the UI shows a "domain already taken" error and the Save button is disabled, even though the domain belongs to the app being edited.
Root Cause
Race condition in
client/src/components/apps/form.vue. Inmounted(),getDomains()andloadPipelineAndApp()run concurrently viaPromise.all. InsideloadPipelineAndApp(),loadApp()is called but not awaited, sogetDomains()resolves first. When it callswhiteListDomains(),this.ingress.hostsis still empty — the app's own domain is never excluded fromtakenDomains. The backend enforces no domain uniqueness; this is purely a frontend bug.This was introduced in PR #265 (v2.0.0, Jan 2024).
Additionally,
whiteListDomains()has a splice index bug that makes it unreliable even when called in the correct order (mutating an array while iterating by index).Steps to Reproduce
Fix
1. Make
loadApp()async:2. Await
loadApp()insideloadPipelineAndApp():3. Fix
whiteListDomains()splice bug:I will submit a PR with these fixes shortly.