Renaming tag do not rename tag's IMAP label
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 348
- Avg merge
- 12h 28m
- Merged PRs (30d)
- 91
Description
Steps to reproduce
- open the "Edit Tags" modal
- create a new tag "Test"
- rename the just created tag to "Test2"
- 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
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.
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