taers232c / GAMADV-XTD3

Command line tool to manage Google Workspace
714 stars 87 forks source link

`KeyError: 'text'` in `printShowNotes`, `_showNote`, `_showNoteListItems` #254

Closed matthewlmcclure closed 2 years ago

matthewlmcclure commented 2 years ago

The following command raised an unhandled exception when it encountered a Keep note that has two checkbox items where the second item has no text.

$ gam user user@example.com show notes filter 'create_time > "2022-03-09T00:00:00-05:00"'
Note: notes/1FnlL6FVSO3WByChni_46Edh48fJXaY-HdFWBvQM-P9Q1r4UxTf98g_jY7vjminE (1/1006)
  title:
  createTime: 2022-03-09T15:36:23Z
  updateTime: 2022-03-09T17:06:48Z
  trashTime: Never
  owner: user@example.com
  ownedByMe: True
  permissions:
    name: notes/1FnlL6FVSO3WByChni_46Edh48fJXaY-HdFWBvQM-P9Q1r4UxTf98g_jY7vjminE/permissions/AfoJJ7bkp7yTFnFqyAjUQiCuSPPsZ22-2lCdnIyi
      role: OWNER
      user: user@example.com
  list:
    item: (1/2)
      text: https://mullvad.net/en/\n\nVPN\nConsumer\nVia https://www.nytimes.com/wirecutter/reviews/best-vpn-service/
      checked: False
    item: (2/2)
Traceback (most recent call last):
  File "__init__.py", line 60746, in ProcessGAMCommand
  File "__init__.py", line 59025, in printShowNotes
  File "__init__.py", line 58783, in _showNote
  File "__init__.py", line 58703, in _showNoteListItems
KeyError: 'text'
image
taers232c commented 2 years ago

Will be fixed shortly.

taers232c commented 2 years ago

Fixed 6.16.11

Thanks for your help.

matthewlmcclure commented 2 years ago

My pleasure. Thanks for the quick fix!

$ gam user user@example.com show notes filter 'create_time > "2022-03-09T21:00:00-05:00"'
Note: notes/12e1wBWWMlBYmYVYMGochfJKrsTPmdGZAHkfJgo1YKcxGx-_Qqb-BpNfxe0dxPg
  title:
  createTime: 2022-03-10T02:56:24Z
  updateTime: 2022-03-10T02:56:32Z
  trashTime: Never
  owner: user@example.com
  ownedByMe: True
  permissions:
    name: notes/12e1wBWWMlBYmYVYMGochfJKrsTPmdGZAHkfJgo1YKcxGx-_Qqb-BpNfxe0dxPg/permissions/AfoJJ7YYNqnexF_Ay77pbH0_RW5pnZWM2wDMPDaB
      role: OWNER
      user: user@example.com
  list:
    item: (1/2)
      text: test
      checked: False
    item: (2/2)
      checked: False