Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark canceled Outlook events as having status=cancelled. #218

Open
rattrayalex opened this issue Jun 18, 2021 · 3 comments
Open

Mark canceled Outlook events as having status=cancelled. #218

rattrayalex opened this issue Jun 18, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@rattrayalex
Copy link

rattrayalex commented Jun 18, 2021

Events that are canceled in outlook do not use the "cancelled" status in iCal format, eg;
Screen Shot 2021-06-18 at 10 10 23 AM
will have STATUS:CONFIRMED in the iCal event, so they show up like a normal event in Google Calendar:
Screen Shot 2021-06-18 at 10 17 00 AM
which means they send notifications as if the event were still happening.

However, the event's summary will be prefixed with the text Canceled:

Additionally, it is possible that some event producers use the spelling "canceled" while Google Calendar requires the status to be spelled "cancelled" (both are valid english). (nevermind, since this would violate the spec as you mentioned).

I made the following code change in my instance to address this, but it's possible that only the latter change is really needed:

  if (event.hasProperty('status')){
    var status = event.getFirstPropertyValue('status').toString().toLowerCase();
    if (["confirmed", "tentative", "cancelled"].indexOf(status) > -1){
      newEvent.status = status;
    }
  }
  if (event.hasProperty('summary') && icalEvent.summary.startsWith('Canceled: ')) {
    Logger.log('Event summary says canceled', icalEvent.summary, 'status had been recognized as', status, 'but setting to "cancelled"');
    newEvent.status = 'cancelled';
  }

Alternatively, the canceled events could simply be removed from the new calendar.

I think this can get complicated when a recurring event is cancelled (I'm not really sure how that works).

Happy to put up a PR for this if you like.

@rattrayalex rattrayalex added the enhancement New feature or request label Jun 18, 2021
@derekantrican
Copy link
Owner

That seems like an Outlook bug. I'd rather report it to them first. Could you provide some repro steps so I can repro on my own Outlook calendar, then submit to them?

If it gets marked as "won't fix" or something, then I'd be happy to consider a workaround fix like yours

@jonas0b1011001
Copy link
Collaborator

Additionally, it is possible that some event producers use the spelling "canceled" while Google Calendar requires the status to be spelled "cancelled" (both are valid english).

That's why there are standards that clearly define how things should be done. RFC5545 clearly states that cancelled should be the only valid version.

Alternatively, the canceled events could simply be removed from the new calendar.

Setting status = cancelled moves the event to the calendar's recycle bin, so that's basically the same as removing it. I assume that's the same for outlook and gcal, which is why outlook is not setting the status property.

Could you share the definition of the example event from above (open the *.ics in a text editor)? I'm pretty sure there's a outlook specific property to mark it as cancelled.

@rattrayalex
Copy link
Author

Thanks for the quick eyes on this!

Here's a censored version of the above event:

BEGIN:VEVENT
DESCRIPTION:adhoc instead\n
UID:040000008200E00074C5B7101A82E00800000000B2AF2AC45A2AD701000000000000000
 01000000020BF252A5398604C817266302DAE11EC
RECURRENCE-ID;TZID=Pacific Standard Time:20210531T153000
SUMMARY:Canceled: Backlog Refinement
DTSTART;TZID=Pacific Standard Time:20210531T153000
DTEND;TZID=Pacific Standard Time:20210531T160000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20210618T140254Z
TRANSP:TRANSPARENT
STATUS:CONFIRMED
SEQUENCE:18
LOCATION:https://us02web.zoom.us/j/CENSORED
X-MICROSOFT-CDO-APPT-SEQUENCE:18
X-MICROSOFT-CDO-BUSYSTATUS:FREE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:3
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT

I think this may typically happen for situations where the recurring event is canceled, but the individual instances are not themselves canceled. On the Outlook UI there's a button that says "Remove events" (or maybe it was "Remove series") in these situations – so I think it's an "intentional product feature" from their end that "canceled" events aren't really canceled, since they don't seem to want them to go to the recycling bin until the user sends them there.

Speaking of, I think this might be the root/parent recurring event:

BEGIN:VEVENT
DESCRIPTION:new Backlog refinement meeting structure\n
RRULE:FREQ=WEEKLY;UNTIL=20220616T223000Z;INTERVAL=1;BYDAY=TH;WKST=SU
EXDATE;TZID=Pacific Standard Time:20210429T153000,20210506T153000,20210520T
 153000
UID:040000008200E00074C5B7101A82E008000000007CCB0D865C2AD701000000000000000
 0100000008CBBFCE675A92E4CB0E3AFD4CD248874
SUMMARY:Canceled: Backlog Refinement
DTSTART;TZID=Pacific Standard Time:20210408T153000
DTEND;TZID=Pacific Standard Time:20210408T160000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20210618T140254Z
TRANSP:TRANSPARENT
STATUS:CONFIRMED
SEQUENCE:17
LOCATION:https://us02web.zoom.us/j/CONFIRMED
X-MICROSOFT-CDO-APPT-SEQUENCE:17
X-MICROSOFT-CDO-BUSYSTATUS:FREE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:1
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT

But nothing jumps out to me as being relevant.

I tried "reporting" this issue here but based on the non-response to some ~related messages, I don't anticipate a response from Microsoft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants