syncall icon indicating copy to clipboard operation
syncall copied to clipboard

Entering "all-day" events for today in Gcal sync to TW for the next day at 00:00

Open bcohen44 opened this issue 2 years ago • 1 comments

Not sure if this a bug or a feature request. If I enter an all-day event in my calendar, it syncs to TW as a task with a due date of the following day at 00:00.

Could we have it sync to the day in the calendar as 00:00, not the next day? This way we can sync tasks w/o a due time to our calendars properly.

bcohen44 avatar Jun 04 '22 11:06 bcohen44

Also, subsequent syncs, getting a Runtime Error:

Traceback (most recent call last):

  File "/home/BOSDYN/bcohen/.local/bin/tw_gcal_sync", line 8, in <module>
    sys.exit(main())
    │   │    └ <click.core.Command object at 0x7f7bab2c4ee0>
    │   └ <built-in function exit>
    └ <module 'sys' (built-in)>

  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
           │    │     │       └ {}
           │    │     └ ()
           │    └ <function BaseCommand.main at 0x7f7bad646670>
           └ <click.core.Command object at 0x7f7bab2c4ee0>

  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
         │    │      └ <click.core.Context object at 0x7f7bab615b50>
         │    └ <function Command.invoke at 0x7f7bad647040>
         └ <click.core.Command object at 0x7f7bab2c4ee0>

  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           │   │      │    │           │   └ {'gcal_calendar': 'Taskwarrior', 'tw_tags': ('cal',), 'verbose': 1, 'google_secret': '/home/BOSDYN/bcohen/gcal_client_secret....
           │   │      │    │           └ <click.core.Context object at 0x7f7bab615b50>
           │   │      │    └ <function main at 0x7f7bab286c10>
           │   │      └ <click.core.Command object at 0x7f7bab2c4ee0>
           │   └ <function Context.invoke at 0x7f7bad6461f0>
           └ <click.core.Context object at 0x7f7bab615b50>

  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
           │         │       └ {'gcal_calendar': 'Taskwarrior', 'tw_tags': ('cal',), 'verbose': 1, 'google_secret': '/home/BOSDYN/bcohen/gcal_client_secret....
           │         └ ()
           └ <function main at 0x7f7bab286c10>

> File "/home/BOSDYN/bcohen/.local/lib/python3.8/site-packages/taskwarrior_syncall/scripts/tw_gcal_sync.py", line 164, in main
    aggregator.sync()
    │          └ <function Aggregator.sync at 0x7f7bad6e34c0>
    └ <taskwarrior_syncall.aggregator.Aggregator object at 0x7f7bab21ce80>
  File "/home/BOSDYN/bcohen/.local/lib/python3.8/site-packages/taskwarrior_syncall/aggregator.py", line 177, in sync
    changes_A = self.detect_changes(self._helper_A, items_A)
                │    │              │    │          └ {'6bmtbnpi85j6u0mamplq5gooag': {'kind': 'calendar#event', 'etag': '"3308677977314000"', 'id': '6bmtbnpi85j6u0mamplq5gooag', '...
                │    │              │    └ SideHelper(name='Gcal', id_key='id', summary_key='summary', other=SideHelper(name='Tw', id_key='uuid', summary_key='descripti...
                │    │              └ <taskwarrior_syncall.aggregator.Aggregator object at 0x7f7bab21ce80>
                │    └ <function Aggregator.detect_changes at 0x7f7bad6e3430>
                └ <taskwarrior_syncall.aggregator.Aggregator object at 0x7f7bab21ce80>
  File "/home/BOSDYN/bcohen/.local/lib/python3.8/site-packages/taskwarrior_syncall/aggregator.py", line 159, in detect_changes
    if self._item_has_update(prev_item=cached_item, new_item=item, helper=helper):
       │    │                          │                     │            └ SideHelper(name='Gcal', id_key='id', summary_key='summary', other=SideHelper(name='Tw', id_key='uuid', summary_key='descripti...
       │    │                          │                     └ {'kind': 'calendar#event', 'etag': '"3308684945716000"', 'id': '22jt9celltlefh141fmnctbhth', 'status': 'confirmed', 'htmlLink...
       │    │                          └ {'kind': 'calendar#event', 'etag': '"3308684945716000"', 'id': '22jt9celltlefh141fmnctbhth', 'status': 'confirmed', 'htmlLink...
       │    └ <function Aggregator._item_has_update at 0x7f7bad6e38b0>
       └ <taskwarrior_syncall.aggregator.Aggregator object at 0x7f7bab21ce80>
  File "/home/BOSDYN/bcohen/.local/lib/python3.8/site-packages/taskwarrior_syncall/aggregator.py", line 264, in _item_has_update
    return not side.items_are_identical(
               │    └ <classmethod object at 0x7f7bab1fcd60>
               └ <taskwarrior_syncall.google.gcal_side.GCalSide object at 0x7f7bab21ceb0>
  File "/home/BOSDYN/bcohen/.local/lib/python3.8/site-packages/taskwarrior_syncall/google/gcal_side.py", line 282, in items_are_identical
    item[key] = cls.parse_datetime(item[key])
    │    │      │   │              │    └ 'end'
    │    │      │   │              └ {'kind': 'calendar#event', 'etag': '"3308684945716000"', 'id': '22jt9celltlefh141fmnctbhth', 'status': 'confirmed', 'htmlLink...
    │    │      │   └ <classmethod object at 0x7f7bab58bdc0>
    │    │      └ <class 'taskwarrior_syncall.google.gcal_side.GCalSide'>
    │    └ 'end'
    └ {'kind': 'calendar#event', 'etag': '"3308684945716000"', 'id': '22jt9celltlefh141fmnctbhth', 'status': 'confirmed', 'htmlLink...
  File "/home/BOSDYN/bcohen/.local/lib/python3.8/site-packages/taskwarrior_syncall/google/gcal_side.py", line 260, in parse_datetime
    raise RuntimeError(f"Invalid structure dict: {dt}")

RuntimeError: Invalid structure dict: {'date': '2022-06-05'}

bcohen44 avatar Jun 04 '22 11:06 bcohen44

RuntimeError: Invalid structure dict: {'date': '2022-06-05'}

This should now be fixed.

If I enter an all-day event in my calendar, it syncs to TW as a task with a due date of the following day at 00:00.

This is the expected behavior AFAICT. tw_gcal_sync will match the event end date with the TW due field which in this case is the start of the next day.

bergercookie avatar Jan 19 '23 17:01 bergercookie