Skip to content

Commit b0b8048

Browse files
authored
fix(console): stop coercing plain SIP queue targets into skill groups (#227)
reconcileSkillGroupTargets() ran extractSkillGroupId() on every dial target, but that helper returns its input unchanged when there is no "skill-group:" prefix. As a result a plain SIP target such as "sip:1000@localhost" was rewritten to "skill-group:sip:1000@localhost" and rendered as a skill-group dropdown on every (re)load of the queue detail form — even on deployments without the CC addon, where /cc/skill-groups returns 404 and the target can never resolve. Guard the reconciliation so it only applies to targets that are already skill groups (skill-group: URI prefix or an explicit skill_group_id), leaving SIP targets untouched.
1 parent 31eb9b9 commit b0b8048

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/addons/queue/templates/queue_detail.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,18 @@ <h3 class="text-sm font-semibold text-slate-800" x-text="tt('queue.section_final
837837
if (!target || typeof target !== 'object') {
838838
return;
839839
}
840+
// Only reconcile targets that are ACTUALLY skill groups.
841+
// `extractSkillGroupId` returns its input unchanged when there is no
842+
// `skill-group:` prefix, so without this guard a plain SIP target
843+
// (e.g. `sip:1000@localhost`) would be coerced into
844+
// `skill-group:sip:1000@localhost` and rendered as a skill-group
845+
// dropdown every time the form is (re)loaded.
846+
const isSkillGroup =
847+
(typeof target.uri === 'string' && /^skill(?:-|_)?group:/i.test(target.uri)) ||
848+
!!target.skill_group_id;
849+
if (!isSkillGroup) {
850+
return;
851+
}
840852
const groupId = this.extractSkillGroupId(target.skill_group_id || target.uri);
841853
if (!groupId) {
842854
return;

0 commit comments

Comments
 (0)