{"action":"created","issue":{"url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/5810","labels_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/5810/labels{/name}","comments_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/5810/comments","events_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/5810/events","html_url":"https://github.com/HabitRPG/habitrpg/issues/5810","id":101706727,"number":5810,"title":"Phantom tags on tasks","user":{"login":"me-and","id":1397507,"avatar_url":"https://avatars.githubusercontent.com/u/1397507?v=3","gravatar_id":"","url":"https://api.github.com/users/me-and","html_url":"https://github.com/me-and","followers_url":"https://api.github.com/users/me-and/followers","following_url":"https://api.github.com/users/me-and/following{/other_user}","gists_url":"https://api.github.com/users/me-and/gists{/gist_id}","starred_url":"https://api.github.com/users/me-and/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/me-and/subscriptions","organizations_url":"https://api.github.com/users/me-and/orgs","repos_url":"https://api.github.com/users/me-and/repos","events_url":"https://api.github.com/users/me-and/events{/privacy}","received_events_url":"https://api.github.com/users/me-and/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-18T17:24:16Z","updated_at":"2015-08-18T18:04:12Z","closed_at":null,"body":"Using the API to fetch tasks, I can see some of my tasks have tags with IDs that don't appear in my list of tags, and don't appear as tags in the web interface.\r\n\r\nHere's some code to demonstrate the problem:\r\n\r\n```python\r\n>>> import requests\r\n>>> from pprint import pprint\r\n\r\n>>> pprint(requests.get(\r\n...     'https://habitica.com/api/v2/user/tasks/d18b692e-2356-40a2-b5d3-e60d77853cc5',\r\n...     headers={'content-type': 'application/json',\r\n...              'x-api-user': '1186f4a9-a39c-4448-bc18-1c4e00e818bc',\r\n...              'x-api-key': api_key}\r\n...     ).json()['tags'])  # This gives the list of tag IDs on the specified task\r\n{'5d6dbf8a-f818-4f92-8b34-832555cfd00d': True}\r\n\r\n>>> pprint(requests.get(\r\n...     'https://habitica.com/api/v2/user',\r\n...     headers={'content-type': 'application/json',\r\n...              'x-api-user': '1186f4a9-a39c-4448-bc18-1c4e00e818bc',\r\n...              'x-api-key': api_key}\r\n...     ).json()['tags'])  # This gives the definitions of all the tags on my account\r\n[{'challenge': 'true',\r\n  'id': '4a22b72c-c4c9-40b0-be0a-0f3a07ade6c0',\r\n  'name': 'Challenges'},\r\n {'id': '26b54d83-8337-400f-941d-b1d6e32d3077', 'name': 'recurring'},\r\n {'id': '645f0380-6f11-4fa9-b8ef-efda496cc160', 'name': 'Today'}]\r\n```\r\n\r\nNote the `5d6dbf...` tag on the task in the first request just doesn't appear in the list of tags in the second request.\r\n\r\nIt appears to be impossible to delete the tag, too. It doesn't appear on the web interfaces, so cannot be deleted there, and attempts via the API seem to have no effect:\r\n\r\n```python\r\n>>> requests.put(\r\n...     'https://habitica.com/api/v2/user/tasks/d18b692e-2356-40a2-b5d3-e60d77853cc5',\r\n...     headers={'content-type': 'application/json',\r\n...              'x-api-user': '1186f4a9-a39c-4448-bc18-1c4e00e818bc',\r\n...              'x-api-key': api_key},\r\n...     data={'tags': {}})\r\n<Response [200]>\r\n\r\n>>> pprint(requests.get(\r\n...     'https://habitica.com/api/v2/user/tasks/d18b692e-2356-40a2-b5d3-e60d77853cc5',\r\n...     headers={'content-type': 'application/json',\r\n...              'x-api-user': '1186f4a9-a39c-4448-bc18-1c4e00e818bc',\r\n...              'x-api-key': api_key}\r\n...     ).json()['tags'])\r\n{'5d6dbf8a-f818-4f92-8b34-832555cfd00d': True}\r\n```\r\n\r\nThis is neither the only task with this phantom tag, nor the only such phantom tag.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/25913791-phantom-tags-on-tasks?utm_campaign=plugin&utm_content=tracker%2F68393&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F68393&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/comments/132299950","html_url":"https://github.com/HabitRPG/habitrpg/issues/5810#issuecomment-132299950","issue_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/5810","id":132299950,"user":{"login":"me-and","id":1397507,"avatar_url":"https://avatars.githubusercontent.com/u/1397507?v=3","gravatar_id":"","url":"https://api.github.com/users/me-and","html_url":"https://github.com/me-and","followers_url":"https://api.github.com/users/me-and/followers","following_url":"https://api.github.com/users/me-and/following{/other_user}","gists_url":"https://api.github.com/users/me-and/gists{/gist_id}","starred_url":"https://api.github.com/users/me-and/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/me-and/subscriptions","organizations_url":"https://api.github.com/users/me-and/orgs","repos_url":"https://api.github.com/users/me-and/repos","events_url":"https://api.github.com/users/me-and/events{/privacy}","received_events_url":"https://api.github.com/users/me-and/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T18:04:12Z","updated_at":"2015-08-18T18:04:12Z","body":"Okay, that makes sense. It is causing problems for the Python API module I'm trying to write, as that is trying to parse those tags and failing because the information is missing, but I'll just work around that for now, and possibly look at writing that code to remove the tags when they're deleted."}}