phw198 / OutlookGoogleCalendarSync

Sync your Outlook and Google calendars
https://www.outlookgooglecalendarsync.com/
Mozilla Public License 2.0
1.8k stars 216 forks source link

Copied/pasted event in Outlook doesn't sync to Google Calendar; Delete action attempted #924

Closed mhowie22 closed 4 years ago

mhowie22 commented 4 years ago

:memo: Use the below template to report your issue.
:bulb: Upgrade to the latest alpha release to check if the problem is already fixed.
:paperclip: To aid investigation, provide your OGcalsync.log file (see instructions).


OGCS Version: v2.8.2.0 Installed or Portable: Installed

Problem Description
Discovered a bug when syncing bi-directionally between Outlook and Google Calendar- specifically, when one creates a new event (appointment) within Outlook by using an existing event (i.e., copy and paste an existing event into a new timeslot), the event is not synced to Google Calendar. In addition, and perhaps more concerning, OGCS will then actually delete this event in Outlook as the Outlook <--- Google sync process runs. It seems as if Google Calendar sort of recognized the event but since it didn't actually get synced over is viewed as a deleted event within Google and, therefore, the deletion process occurs.

Steps to Reproduce the Issue

  1. Repeatable

Any other information
Can provide logfile via email. Today's version- with the reported bugs- would be available at midnight local as it appears OGCS creates a debug log daily at that time as I view the files available via the "Open Log" selection. I've pasted a representative sync screen below- each one of the entries under the Outlook <--- Google sync section are active Outlook events which were created by copying/pasting events of the same name (truly a copy/paste to a different date).

image

mhowie22 commented 4 years ago

Is additional detail required or is this being investigated? I'm unsure how the bug verification/resolution process works with OGCS. Thanks.

phw198 commented 4 years ago

It's a documented known issue - you need to make sure OGCS is running (and not actively syncing) when copy and pasting.

YasharF commented 4 years ago

Is there a way to potentially address this known issue? I missed an appointment earlier which I knew I had copied from its last occurrence to an upcoming timeslot.

My workflow doesn't involve having Outlook running all of the time and hence I don't have OGC running all the time either. Sometimes I forget to open OGC after opening Outlook and it looks like the human error from my end to not copy calendar entries while OGC isn't open might be inevitable.

Lusayalumino commented 4 years ago

Hi Yashar, FYI: I've been working on this with phw198 here at #946 https://github.com/phw198/OutlookGoogleCalendarSync/issues/946#issuecomment-586654986

phw198 commented 4 years ago

@YasharF So the issue is, some code needs to run to clean out the OGCS properties from a manually copied item in Outlook. Options currently are:

  1. Ensure OGCS is running in the background to execute the necessary code
    1. Set OGCS to start on startup and leave in the background (eg start in task tray)
    2. Set OGCS to start whenever Outlook is started (VBA code available)
  2. Deploy some VBA code into Outlook that runs the equivalent code normally run by OGCS.
    1. This doesn't exist yet, but I'm playing with this option now - if people really don't want OGCS runing in the background, then this would be the only sure-fire way of avoiding the issue.
Lusayalumino commented 4 years ago

As an fyi, I have an issue when starting my computer where I'm asked to "Allow" OGCS ... but it asks me about 5-8 times... so I set the "Start on login, with delay of" to the max of 300 seconds. Is this possibly part of my problem on https://github.com/phw198/OutlookGoogleCalendarSync/issues/946

YasharF commented 4 years ago

I like option 2, assuming that the user isn't required to manually trigger the VBA code. Other sync and export/import software that I have used, had some add-on components that sat within Outlook: MyPhoneExplorer, CodeTwo. Before installing OGCS, I thought it is an add-on as well.

phw198 commented 4 years ago

@Lusayalumino I guess the delay could be part of the problem if you copy and paste an appointment during that delay when OGCS isn't actually running?

@YasharF OK, I've finally got round to completing that VBA code! Posted up with some documentation on how to deploy it - let me know if you use it and how it goes...

YasharF commented 4 years ago

I just followed the instructions, a few notes:

YasharF commented 4 years ago

Reporting back: It looks like it is trying to delete an appointment that I copied about a couple of hours ago. It looks like it took more than an hour for it to decide to delete the appointment: image

The copy event:

2020-03-30 10:52:29,349 INFO  24 OutlookGoogleCalendarSync.OutlookOgcs.ExplorerWatcher [0] -  Item paste event caught.
2020-03-30 10:52:29,365 DEBUG  24 OutlookGoogleCalendarSync.OutlookOgcs.ExplorerWatcher [0] -  We've got 1 items selected for copy.
2020-03-30 10:52:29,379 FINE  24 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  GetSummary - not all day event
2020-03-30 10:52:29,380 DEBUG  24 OutlookGoogleCalendarSync.OutlookOgcs.ExplorerWatcher [0] -  3/18/2020 4:00 PM => "SLG Budget"
2020-03-30 10:52:29,482 INFO  24 OutlookGoogleCalendarSync.OutlookOgcs.ExplorerWatcher [0] -  Temporarily removing OGCS properties from copied Outlook appointment item.
2020-03-30 10:52:29,498 FINE  24 OutlookGoogleCalendarSync.OutlookOgcs.ExplorerWatcher [0] -  Backing up googleCalendarID
2020-03-30 10:52:29,511 FINE  24 OutlookGoogleCalendarSync.OutlookOgcs.ExplorerWatcher [0] -  Backing up googleEventID
2020-03-30 10:52:29,585 DEBUG  24 OutlookGoogleCalendarSync.OutlookOgcs.CustomProperty [0] -  Removed googleEventID property.
2020-03-30 10:52:29,634 DEBUG  24 OutlookGoogleCalendarSync.OutlookOgcs.CustomProperty [0] -  Removed googleCalendarID property.
2020-03-30 10:52:29,741 FINE  24 OutlookGoogleCalendarSync.OutlookOgcs.CustomProperty [0] -  Set userproperty locallyCopied=True
2020-03-30 10:52:31,765 DEBUG  8 OutlookGoogleCalendarSync.OutlookOgcs.ExplorerWatcher [0] -  Repopulating IDs to original copied Outlook item
2020-03-30 10:52:33,767 DEBUG  8 OutlookGoogleCalendarSync.OutlookOgcs.ExplorerWatcher [0] -  Untagging copied Outlook item
2020-03-30 10:52:33,799 FINE  8 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  GetSummary - not all day event
2020-03-30 10:52:33,801 DEBUG  8 OutlookGoogleCalendarSync.OutlookOgcs.ExplorerWatcher [0] -  3/31/2020 4:00 PM => "SLG Budget"
2020-03-30 10:52:33,938 DEBUG  8 OutlookGoogleCalendarSync.OutlookOgcs.ExplorerWatcher [0] -  Removed locallyCopied property.
2020-03-30 10:52:34,094 FINE  8 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  GetSummary - not all day event
2020-03-30 10:52:34,095 DEBUG  8 OutlookGoogleCalendarSync.OutlookOgcs.ExplorerWatcher [0] -  3/31/2020 4:00 PM => "SLG Budget"
2020-03-30 10:52:34,134 FINE  8 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  GetSummary - not all day event
2020-03-30 10:52:34,135 DEBUG  8 OutlookGoogleCalendarSync.OutlookOgcs.CustomProperty [0] -  3/31/2020 4:00 PM => "SLG Budget"

...

2020-03-30 10:54:26,236 FINE  21 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  GetSummary - not all day event
2020-03-30 10:54:26,237 DEBUG  21 OutlookGoogleCalendarSync.OutlookOgcs.CustomProperty [0] -  3/31/2020 4:00 PM => "SLG Budget"
2020-03-30 10:54:26,251 DEBUG  21 OutlookGoogleCalendarSync.OutlookOgcs.CustomProperty [0] -  googleCalendarID=yas****@****.com
2020-03-30 10:54:26,264 DEBUG  21 OutlookGoogleCalendarSync.OutlookOgcs.CustomProperty [0] -  googleEventID=5rkpr966rm44l3loancl83ofcg

...

2020-03-30 10:54:30,434 FINE  21 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  Comparing Google Event ID
2020-03-30 10:54:30,520 FINE  21 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  Comparing Google Calendar ID
2020-03-30 10:54:30,572 FINE  21 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  GetSummary - not all day event
2020-03-30 10:54:30,573 FINE  21 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  Checking 3/31/2020 4:00 PM => "SLG Budget"

and now:


2020-03-30 12:20:00,403 FINE  26 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  GetSummary - not all day event
2020-03-30 12:20:00,405 DEBUG  26 OutlookGoogleCalendarSync.OutlookOgcs.CustomProperty [0] -  3/31/2020 4:00 PM => "SLG Budget"
2020-03-30 12:20:00,421 DEBUG  26 OutlookGoogleCalendarSync.OutlookOgcs.CustomProperty [0] -  googleCalendarID=yas****@****.com
2020-03-30 12:20:00,434 DEBUG  26 OutlookGoogleCalendarSync.OutlookOgcs.CustomProperty [0] -  googleEventID=5rkpr966rm44l3loancl83ofcg
2020-03-30 12:20:00,494 FINE  26 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  GetSummary - not all day event

...

2020-03-30 12:20:00,784 DEBUG  26 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  0 unclaimed.
2020-03-30 12:20:00,784 DEBUG  26 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  Comparing Google events to Outlook items...
2020-03-30 12:20:00,784 DEBUG  26 OutlookGoogleCalendarSync.Console [0] -  Matching calendar items...

...

2020-03-30 12:20:04,416 INFO  26 OutlookGoogleCalendarSync.Console [0] -  1 Outlook calendar entries to be deleted.
2020-03-30 12:20:04,417 INFO  26 OutlookGoogleCalendarSync.Console [0] -  0 Outlook calendar entries to be created.
2020-03-30 12:20:04,417 INFO  26 OutlookGoogleCalendarSync.Console [0] -  12 calendar entries to be compared.
2020-03-30 12:20:04,486 INFO  26 OutlookGoogleCalendarSync.Console [0] -  Deleting 1 Outlook calendar entries
2020-03-30 12:20:04,499 FINE  26 OutlookGoogleCalendarSync.OutlookOgcs.Calendar [0] -  GetSummary - not all day event
YasharF commented 4 years ago

I am looking at my google calendar, and it looks like even though at 10:52 a copy event was recognized, it never created the event in my Google Calendar.

Clarification: I didn't copy the appointment, I moved it from 3/18 (past) to 3/31 (tomorrow). I haven't said No to the above prompt and not closed it yet and it looks like the appointment at the old date (3/18) is still there in the google calendar, while it is showing on the new date of 3/31 in Outlook. OGSC is trying to delete the new one in Outlook on 3/31.

Lusayalumino commented 4 years ago

I'm really glad you guys are still working on this. FYI: I have an NVidea GPU. I've disabled OGCS for now -- it just wasn't usable until this is resolved. I hope you figure it out!

YasharF commented 4 years ago

Another update, the delete prompt above for that appointment kept reappearing since my last update with every sync. I have been choosing No. This morning I moved that appointment to noon today when OGCS was open. Walked away for about an hour and now I see that at 11:30ish it tried to do a sync and the delete confirmation for the new timeslot of noon today is now popping up.

image

phw198 commented 4 years ago

@YasharF Thanks for the feedback :+1:

phw198 commented 4 years ago

@YasharF Oh my....this is a huge bug! A move is being detected as a copy event - I'll track this one over on #912 where I never reached this conclusion.

phw198 commented 4 years ago

@YasharF Seems I jumped the gun there...slightly relieved as that bug would have been rather an oversight.

So after the item is moved or copied, the original item OGCS properties are then restored (one and the same item in the case of a move).

2020-03-30 10:52:31,765 DEBUG  8 OutlookGoogleCalendarSync.OutlookOgcs.ExplorerWatcher [0] -  Repopulating IDs to original copied Outlook item
2020-03-30 10:54:26,237 DEBUG  21 OutlookGoogleCalendarSync.OutlookOgcs.CustomProperty [0] -  3/31/2020 4:00 PM => "SLG Budget"
2020-03-30 10:54:26,251 DEBUG  21 OutlookGoogleCalendarSync.OutlookOgcs.CustomProperty [0] -  googleCalendarID=yas****@****.com
2020-03-30 10:54:26,264 DEBUG  21 OutlookGoogleCalendarSync.OutlookOgcs.CustomProperty [0] -  googleEventID=5rkpr966rm44l3loancl83ofcg

So we need to figure out why the eventID of the Google item has changed. Could you turn on CSV export in OGCS settings - then when you get a delete prompt, check the google_events.csv file and see what the EventId is, whether this has changed and therefore whether it still matches Outlook (5rkpr966rm44l3loancl83ofcg in your previous example).

YasharF commented 4 years ago

To answer your question, I don't see the event in google_events.csv

I think I figured out how to trigger the issue reliably, at least for one case. The prerequisite is that the old items must have got synced before, but it is no longer within the date range that OCGS syncs at the time the appointment is being moved.

Steps to reproduce it:

  1. Under the settings change Sync Options->When->Date range to be longer. For example, if it is set to 5 days in the past, then set it to 10 days. Press Save.
  2. Under the Sync tab, press Start Sync in OGCS and wait until it finishes.
  3. Create an event in Outlook named test-past in a timeslot 7 days ago.
  4. If the sync hasn't started automatically, press Start Sync in OGCS and wait until it finishes. It is OK to sync multiple times if not sure.
  5. Open calendar.google.com and verify that the test-past appointment has been created in the timeslot that was 7 days ago.
  6. In OGSC, under the settings change Sync Options->When->Date range to be the original number of days. For example, back to 5 days. Press Save.
  7. In Outlook, move the test-past appointment from 7 days ago to tomorrow.
  8. If the sync hasn't started automatically, press Start Sync in OGCS and wait until it finishes
  9. Repeat sync in step 7 and press Start Sync a second time. At this point, OGSC will (attempt to) delete test-past from tomorrow's timeslot.

It looks like that the sync in step 7, is not putting anything in the calendar for tomorrow, and step 8 thinks 7 has worked but it doesn't see the appointment in Google and it concludes it must have got deleted in Google so it needs to be removed from Outlook as well.

In the above test scenario, we are changing the sync range, but in practice, time will pass and items will move outside of the sync period on their own.

Looking at Google Calendar the appointment that was 7 days ago is still there and hasn't moved. I tried a couple of more steps after the ones above to cover potentially similar edge cases such as if the user has multiple computers with OGSC and different sync ranges, or if the user reinstalls OGSC and ends up with a different sync range (aka the default range in case if they had customized their settings):

  1. After step 8, and deletion of test-past from tomorrow in Outlook, go in the settings and change Sync Options->When->Date range to be a longer range, such as 10 days.
  2. If the sync hasn't started automatically, press Start Sync in OGCS and wait until it finishes

At this point, OGSC will (attempt to) delete the original test-past in Google Calendar from 7 days ago as well, and all traces of the original and the new appointment will be gone from both Outlook and Gmail.

The same issue might be applicable for appointments that are far out in the future when it comes to the "days in future" sync date range, but I haven't done any testing for that case.

phw198 commented 4 years ago

Thanks for the analysis @YasharF - yes certainly when calendar items move across sync window date bounds, what you describe will occur. For moves in Outlook, I have put in some detection of this and automatically adjust the sync window ranges to accomodate the moved item.

:package: If you could do some testing with hotfix v2.8.3.8.zip (see instructions for applying) it'd be greatly appreciated.

Note, for moves in Google, I don't think it's possible to detect the equivalent. I have started capturing known limitations in the wiki.

YasharF commented 4 years ago

Does hotfix 2.8.3.8 include he fix in hotfix 2.8.3.1? I'm currently running the 2.8.3.1 hotfix. If it doesn't do you think if you can cut a release with all of the hotfixes?

Another potential change that might reduce the chances of someone running into an issue might be to increase the default sync window. I have changed mine to 90 days for now. I don't know what the best number would be but have entertained the idea of increasing it to match my Outlook Calendar Archive setting which is 6-months.

phw198 commented 4 years ago

:package: I've pulled the release branch into this fix, so you'll now have all the latest fixes with v2.8.3.9.zip.

Please let me know how it goes.

(Note, we turned off the default O365 6-month archive for calendar items because it annoyed the business so much! Makes sense for email, less so for calendars).

phw198 commented 4 years ago

Hi @YasharF any further feedback on v2.8.3.9?

YasharF commented 4 years ago

I haven't noticed any breaking issues. There are a couple of minor UX issues, but I wouldn't consider them blockers:

  1. The VBA script always tends to pop a security warning in Outlook on startup. I can live with that.
  2. The VBA script opens the OGSC as a maximized window covering the entire monitor screen.

Thanks for the great work.