Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra tags after tag renaming #1058

Closed
gycsaba96 opened this issue Mar 9, 2024 · 4 comments · Fixed by #1062 or #1067
Closed

Extra tags after tag renaming #1058

gycsaba96 opened this issue Mar 9, 2024 · 4 comments · Fixed by #1062 or #1067
Labels
bug low-hanging-fruit "Easy picks" suitable for new contributors to tackle

Comments

@gycsaba96
Copy link
Contributor

Renaming a tag that is a prefix of another tag adds unwanted tags to other tasks.

Steps to reproduce:

  1. Create a task with an @apple tag.
  2. Create a task with an @applepie tag.
  3. Rename the @apple tag using the sidebar's "Edit..." feature to @orange.
  4. Open the second task and observe the unwanted @orangepie tag.

The main cause is possibly that the corresponding method uses a simple search-and-replace for tag renaming. (The code should ensure that it replaces only whole tag names.)

@nekohayo
Copy link
Member

Hmm, I wonder if this might be an explanation for the long-standing super annoying tags duplication issue, #605 ?

It would be awesome if you could try fixing both your issue and that one (if they are not exactly the same) simultaneously :)

@gycsaba96
Copy link
Contributor Author

I think the unwanted tags appear for different reasons in the two cases. Here, we have a faulty renaming. In #605, the tag parsing kicks in too early. (There, we could consider preventing the processing of the current word when parsing the tags.)

Nevertheless, I can take a look at both of them. :)

@nekohayo nekohayo added bug low-hanging-fruit "Easy picks" suitable for new contributors to tackle labels Mar 10, 2024
@nekohayo
Copy link
Member

Does this also get fixed by your PR #1062, or that one was only meant for 605?

@gycsaba96
Copy link
Contributor Author

No, this is still a work in progress. PR 1062 was only for 605.

gycsaba96 added a commit to gycsaba96/gtg that referenced this issue Mar 18, 2024
Since a tag name can be a prefix of another tag or part of an email
address, a simple str.replace() call would lead to unexpected
behaviour.

This fixes GitHub issue getting-things-gnome#1058
diegogangl pushed a commit that referenced this issue Mar 19, 2024
Since a tag name can be a prefix of another tag or part of an email
address, a simple str.replace() call would lead to unexpected
behaviour.

This fixes GitHub issue #1058
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug low-hanging-fruit "Easy picks" suitable for new contributors to tackle
Projects
None yet
2 participants