black-roland/homeassistant-microsoft-todo

Not all lists are being found

Closed this issue · 8 comments

It is all working great for my lists Tasks, Chores, Costco.
But beyond those three, I'm getting errors as seen below:

  • No list with the name Hardware.
  • No list with the name LEC Items.
  • No list with the name Grocery.

Is there any way to view (debug log), what list names MS is providing you?

Tnx

2019-12-15 16:13:00 ERROR (SyncWorker_8) [custom_components.microsoft_todo.calendar] No list with the name Hardware. 
2019-12-15 16:13:00 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback _chain_future.<locals>._set_state(<Future pendi...bac7f3550>()]>, <Future at 0x...StopIteration>) at /usr/local/lib/python3.7/asyncio/futures.py:342
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.7/asyncio/futures.py", line 344, in _set_state
    _copy_future_state(other, future)
  File "/usr/local/lib/python3.7/asyncio/futures.py", line 320, in _copy_future_state
    dest.set_exception(exception)
TypeError: StopIteration interacts badly with generators and cannot be raised into a Future
2019-12-15 16:13:27 ERROR (SyncWorker_11) [homeassistant.core] Error doing job: Task was destroyed but it is pending!
2019-12-15 16:14:06 ERROR (SyncWorker_7) [custom_components.microsoft_todo.calendar] No list with the name LEC Items. 
2019-12-15 16:14:06 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback _chain_future.<locals>._set_state(<Future pendi...bac620810>()]>, <Future at 0x...StopIteration>) at /usr/local/lib/python3.7/asyncio/futures.py:342
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.7/asyncio/futures.py", line 344, in _set_state
    _copy_future_state(other, future)
  File "/usr/local/lib/python3.7/asyncio/futures.py", line 320, in _copy_future_state
    dest.set_exception(exception)
TypeError: StopIteration interacts badly with generators and cannot be raised into a Future
2019-12-15 16:14:39 ERROR (SyncWorker_9) [custom_components.microsoft_todo.calendar] No list with the name Grocery. 
2019-12-15 16:14:39 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback _chain_future.<locals>._set_state(<Future pendi...bb0614c10>()]>, <Future at 0x...StopIteration>) at /usr/local/lib/python3.7/asyncio/futures.py:342
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.7/asyncio/futures.py", line 344, in _set_state
    _copy_future_state(other, future)
  File "/usr/local/lib/python3.7/asyncio/futures.py", line 320, in _copy_future_state
    dest.set_exception(exception)
TypeError: StopIteration interacts badly with generators and cannot be raised into a Future

I found where these are on Oiutlook.com.

https://outlook.live.com/owa/0/?path=/tasks&tasksOptOut=true

Attached screen shot appears to show them all, unless they're using something else, internally.
TaskListFromOutlookCom

Is there any way to view (debug log), what list names MS is providing you?

Sure. Could you try to set the logging level to debug?

logger:
  default: warn
  logs:
    custom_components.microsoft_todo.calendar: debug

All requests and responses should be logged after that.

I'll try again, but I added that debug line yesterday to no avail. It certainly didn't log a list of returned folders. I can revisit this Wednesday & will get back to you. Tnx.

Ok. I stand corrected, I used debug on homeassistant.components.microsoft_todo, not custom_components.microsoft_todo.calendar.

That did return a list of my folders, but only 10 of them - not all.

Any chance that trailing skip=10 looks suspicious?

2019-12-17 15:43:58 DEBUG (SyncWorker_15) [custom_components.microsoft_todo.calendar] To Do lists response: {'@odata.context': "https://graph.microsoft.com/beta/$metadata#users('redacted%40redacted.com')/outlook/taskFolders", '@odata.nextLink': 'https://graph.microsoft.com/beta/me/outlook/taskFolders?$skip=10',

Oh, you're right. Currently, there is no pagination support and only the first 10 items are fetched. As a quick fix, it should be possible to increase the page size. I will take a look.

Hi @genem2, please try the latest version. The issue should be resolved (at least until you have less than 100 lists 🙂).

@black-roland, first of all great component you've built, thanks. However, I'm still experiencing that not all lists are accessible while calling the service to add new items to lists. I have ~60 lists in To Do, so even though the query has 100 objects as max, it's apparently not getting them all. Any chance you would be able to implement the pagination or help here ? (looked at your comment in the code saying not to increase further, and believe it's a potential temporary fix either way).

Thanks a lot!