[DEFECT] Tags portlet ignores new duplicate-detection response from v2 API (silent create dialog, misleading import toast)
@hmoreras is already working on this.
Since Jun 5, 2026.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Problem Statement
The Tags portlet (libs/portlets/dot-tags) does not surface the duplicate-detection information that PR #34604 added to the v2 Tags API. As a result:
-
Create dialog gives no feedback when a tag already exists. When a user submits a tag name that already exists, the backend now returns
200 OKwithcreated: []and the existing tag induplicates[]. The frontend ignores theduplicateslist, reloads the table, and shows nothing — the user cannot tell whether their tag was actually created or silently treated as a no-op. -
Import dialog shows a misleading "success" toast on pure-duplicate imports. The import endpoint now returns a
duplicateCountfield separate fromsuccessCount. The frontend ignoresduplicateCountand decides SUCCESS-vs-WARNING based only onfailureCount === 0. Re-importing a CSV that contains only pre-existing tags shows a SUCCESS toast saying "0 tags imported" — exactly the misleading behavior the backend fix in #34548 was meant to eliminate.
Severity: Medium — tags get created/imported correctly, but the UX gives users wrong information about what happened.
Affected files:
| File | Issue |
|---|---|
libs/data-access/src/lib/dot-tags/dot-tags.service.ts |
createTag() return type is DotTag[] (old shape); importTags() return type is missing duplicateCount |
libs/portlets/dot-tags/src/lib/dot-tags-list/store/dot-tags-list.store.ts |
handleTagAction discards response — store cannot react to created vs duplicates |
libs/portlets/dot-tags/src/lib/dot-tags-list/dot-tags-list.component.ts |
No toast after create; import toast logic ignores duplicateCount |
libs/portlets/dot-tags/src/lib/dot-tags-import/dot-tags-import.component.ts |
Closes dialog with partial response shape |
Steps to Reproduce
Create dialog (silent duplicate):
- Open the Tags portlet
- Create a tag named
marketingon SYSTEM_HOST - Click "Add Tag" and submit the same name
marketingagain - Expected: A toast or message tells the user the tag already exists
- Actual: The dialog closes, the table reloads, no feedback at all
Import dialog (misleading success):
- Open the Tags portlet
- Create tags
abc1,abc2,abc3manually - Click "Import" and upload a CSV containing only
abc1,abc2,abc3 - Expected: A WARNING/INFO toast indicating that 3 tags were skipped as duplicates
- Actual: A SUCCESS toast appears (current code:
failureCount === 0 → SUCCESS), claiming the import succeeded even though zero new tags were imported
Acceptance Criteria
-
DotTagsService.createTag()return type is updated to{ created: DotTag[]; duplicates: DotTag[] }to match the response shape introduced by PR #34604 -
DotTagsService.importTags()return type includes the newduplicateCount: numberfield - Store / list-component plumbing forwards the
createdandduplicatespayload fromcreateTag()to the UI layer (currenthandleTagActiondiscards it) - When a single-tag create returns
created.length === 0 && duplicates.length === 1, the user sees an INFO toast (i18n key:tags.create.duplicate) stating that the tag already exists - When a batch create returns
created.length > 0 && duplicates.length > 0, the user sees an INFO toast summarizing both counts (i18n key:tags.create.mixed) - When a single-tag create returns
created.length === 1 && duplicates.length === 0, the user sees a SUCCESS toast (i18n key:tags.create.success) - Import toast severity is decided by:
failureCount === 0 && duplicateCount === 0→ SUCCESSfailureCount === 0 && duplicateCount > 0→ INFO (new i18n keytags.import.with-duplicates, with placeholders forsuccessCount,duplicateCount,totalRows)failureCount > 0→ WARNING (existingtags.import.partial-success, extended to includeduplicateCountplaceholder)
- All new i18n keys added to English
Messages_en.properties; other locales filled or left untranslated per current repo convention - Unit tests added/updated in
dot-tags.service.spec.ts,dot-tags-list.store.spec.ts,dot-tags-list.component.spec.ts,dot-tags-import.component.spec.tscovering: all-duplicate create, mixed create, all-duplicate import, mixed import - No regression in the existing happy path (all-new create and all-new import still behave as today)
dotCMS Version
Latest from main branch (verified against commit 8938aacf0c). PR #34604 was merged on 2026-02-17.
Severity
Medium - Some functionality impacted
Links
- Backend fix: dotCMS/core#34548 / dotCMS/core#34604
- Verification report (Postman/newman): pass — 24 requests, 49 assertions, 0 failures against local
main @ 8938aacf0c - Freshdesk: NA
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.