todoist icon indicating copy to clipboard operation
todoist copied to clipboard

Tasks without section sometimes still display a section on the `list` command

Open andreoliwa opened this issue 3 years ago • 2 comments

Hi!

There are tasks without a section that still display a section when I use the list command.

This bug doesn't happen with all tasks. Steps to reproduce:

  1. Create a new project called "Example".
  2. Add a task called "Some task" without a section.
  3. Run todoist sync && todoist list -f '#example': the project shows as #Example. ✅
  4. Create a new section called "My Section".
  5. Move "Some task" to "My Section".
  6. Run todoist sync && todoist list -f '#example': the project shows as #Example/My Section. ✅
  7. Move "Some task" out of "My Section", back to the "(No Section)" area.
  8. Run todoist sync && todoist list -f '#example': the project still shows as #Example/My Section. ❌
  9. The correct output is displayed with the show command.

In the details below: a (clean) transcript of my terminal output and some screenshots.

$ todoist sync && todoist list -f '#example'

$ todoist sync && todoist list -f '#example'
4693482710 p4  #Example  Some task

$ todoist sync && todoist list -f '#example'
4693482710 p4  #Example/My Section  Some task

$ todoist sync && todoist list -f '#example'
4693482710 p4  #Example/My Section  Some task

$ todoist sync && todoist show 4693482710
ID       4693482710
Content  Some task
Project  #Example
Labels
Priority p4
DueDate
URL

Screenshot 2021-03-26 at 19 55 12 Screenshot 2021-03-26 at 19 55 02 Screenshot 2021-03-26 at 19 54 47

andreoliwa avatar Mar 26 '21 18:03 andreoliwa

I found out that removing the local cache is a temporary solution for this problem:

$ rm -rvf ~/.cache/todoist
/Users/aa/.cache/todoist/cache.json
/Users/aa/.cache/todoist

So maybe it's something related to loading or saving empty/null sections in the cache. 🤔

andreoliwa avatar Mar 27 '21 16:03 andreoliwa

Yes, you are right about that, It's a bug that will happen when there are null sections. Pull request #162 is to solve this issue.

dwrdx avatar Mar 31 '21 12:03 dwrdx