nextcloud / nextcloud/mail

Renaming tag do not rename tag's IMAP label

Open
#13,275 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Steps to reproduce
  1. open the "Edit Tags" modal
  2. create a new tag "Test"
  3. rename the just created tag to "Test2"
  4. create again a new tag "Test"
Expected behavior

"Test" tag appears on the list, together "Test2"

Actual behavior

"Test2" is replicated in the list, and no "Test" is created (even in the database).

Mail app version

5.10

Nextcloud version

No response

Mailserver or service

No response

Operating system

No response

PHP engine version

None

Nextcloud memory caching

No response

Web server

None

Database

None

Additional info

MailManager::updateTag() doesn't update also the imap_label of the tag, which is left unchanged and after an update no longer matches the display_name. Then, in MailManager::createTag(), the tag is checked for existance using imap_label and when the old value is found the method do not proceed, returning data about the old (and then renamed) tag.

I'm not sure about the correct behavior to apply when updating a tag. Should the tag be entirely updated, and existing and tagged messages should be updated to the new permanent flag? Or an allocated imap_label is no longer assignable, and the condition should be handled to stop the user trying to recreate the same label?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at MailManager::updateTag() and MailManager::createTag(), tracing how display_name and imap_label are persisted and compared during tag renames and creation. Determine the intended behavior for an existing renamed tag, then add coverage showing that renaming and recreating tags produce the expected distinct entries without breaking existing message labels.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.