jobisoft / EAS-4-TbSync

[Thunderbird Add-On] The Exchange ActiveSync provider for TbSync to sync contacts, tasks and calendars to Thunderbird.
https://github.com/jobisoft/EAS-4-TbSync/wiki/About:-Provider-for-Exchange-ActiveSync
Mozilla Public License 2.0
186 stars 28 forks source link

Meeting status (confirmed/tentative) not synching properly #138

Open bjmuld opened 3 years ago

bjmuld commented 3 years ago

Your environment

TbSync version: 2.19 EAS-4-TbSync version: 1.20 Thunderbird version: 78.6.1 (64-bit)

[ ] Yes, I have installed the latest available beta version from https://tbsync.jobisoft.de and my issue is not yet fixed, I can still reproduce it.

Expected behavior

Events' status should remain in sync, and changing event status (tentative/confirmed/cancelled) on one machine should result in the same change on other synced machines.

Actual behavior

Once status is out-of-sync, changing status from confirmed->tentative on one machine results in a change from tentative->confirmed on the other!

Steps to reproduce

unsure how events got out-of-sync, but once out-of-sync, a change in one will result in an incorrect change in the other.

To help resolving your issue, enable debug logging (TbSync Account Manager -> Help) and send me the debug.log via e-mail (use the title of your issue as subject of the email).

offlinehoster commented 3 years ago

We reproduced this issue also. We tested this with 2 different linux systems with thunderbird-tbsync setup. We were able to reproduce this issue.

Even if I accept the event with tbsync or by my incoming mail directory, the appointment will be just tentative and not confirmed be displayed at the web-ui of outlook (https://outlook.office.com) You can crosscheck the outlook web ui and you will see that the invitation is "greyed" on the left side.

When you accept the invite within the web portal you will see that this invite is fully accepted.

We also double checked this issue with another computer, a Mac, accepting invites on a Mac within the Apple Calendar.app will be confirmed correctly.

So I assume that there is an issue / problem with tbsync.

If we can support to solve this issue, please let us know.

Bildschirmfoto von 2021-06-03 11-19-34 Bildschirmfoto von 2021-06-03 11-17-30

bjmuld commented 2 years ago

All my new events created in Lightning (w/TB Sync) are "tentative" by default. Any updates on this?

Olen commented 2 years ago

I looked at the code, and I believe this is the culprit:

//it's pointless to send AttendeeStatus, 
// - if we are the owner of a meeting, TB does not have an option to actually set the attendee status (on behalf of an attendee) in the UI
// - if we are an attendee (of an invite) we cannot and should not set status of other attendees and or own status must be send through a MeetingResponse
// -> all changes of attendee status are send from the server to us, either via ResponseType or via AttendeeStatus
//wbxml.atag("AttendeeStatus", eas.sync.MAP_TB2EAS.ATTENDEESTATUS[attendee.participationStatus]);

https://github.com/jobisoft/EAS-4-TbSync/blob/b0526e906b24025b5df0065518a332c8181198bf/content/includes/calendarsync.js#L383

I don't really understand the rationale here. There is a way to change attendance in the UI - right click a meeting in the calendar, and you can select "Attendance" in the popup menu.

But basically we are not sending updated attendance status FROM Thunderbird TO Exchange, which of course can lead to async status between the two.

So is there a way to ensure that attendance status is also updated from TB to Exchange?

jobisoft commented 2 years ago

Feel free to play with the code, I have not touched that part since ages and do not remember anything. If you get it working, I will merge.

Olen commented 2 years ago

Thanks. Unfortunately I have no experience in coding TB Extensions, but I think it should be doable for someone with a bit of time and some experience.

I guess we need to implement the MeetingResponse Response: https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-ascmd/4beaad23-1bda-4dfe-b816-a205c5bcc7bf

And then, if the attendee.participationStatus changes, it should send a MeetingResponse, not just an updated calendar entry, to EAS.

There is an old document here which explains in more detail how it is supposed to work: https://docs.microsoft.com/en-us/previous-versions/office/developer/exchange-server-interoperability-guidance/hh428685(v=exchg.140)

Users respond to a meeting request from the Calendar folder in the same way that they respond to the request from the Inbox. The client uses the MeetingResponse command, but in this case, the RequestId element value indicates the Calendar item. This option is only available in Exchange ActiveSync version 14.0 and later versions.

Not sure how we would catch this change, but I see that once I change this in the calendar, tbsync reports that one item needs to be synced, so I it should be possible somehow.

Then, there is this part:

The client sends a notification to the meeting organizer if the user chooses to send a response. The client uses the SendMail command to send the notification. The client should send the email notification only after the MeetingResponse command finishes successfully; otherwise, the invitee's Calendar and the status information that the invitee reports to the organizer will be in conflict. If the ResponseRequested element is set to 0 (zero, meaning false) on the meeting request, the client does not expose an option to the user to send a response notification to the organizer.

I guess sending an email is not that hard in TB. But it might be better to acually use the SendMail function in EAS in case there is some Exchange Magic happening with these emails once they are received by the EAS-server. So this should also be added with at least a minimum of functionality.

I think this pseudocode should be added somewhere just before this line here, maybe? https://github.com/jobisoft/EAS-4-TbSync/blob/3e306a6eb63d9b4dddf31691f5fd5b67db5f5f76/content/includes/calendarsync.js#L383

if (asversion >= 14  and attendee == ME and attendee.participationStatus != attendee.previousParticipationStatus)
  let meetingResponseResult = await sendMeetingResponse(item.id, attendee.participationStatus)
  if (meetingResponseResult and ORGANIZER != ME) {
    await sendOrganizerReponse(attendee, item)
  }
}

These must be added somewhere. (In calendarsync.js?)

sendMeetingResponse: async function (id, status) {
  let wbxml = eas.wbxmltools.createWBXML(.... 
  something
  return meetingResponseResult or False;
}
sendOrganizerReponse: async function(attendee, item) {
  subject = attendee.participationStatus + ": " + item.title
  body = ....
  sendMail(from=ME, to=ORGANIZER, subject, body)
}

And then the function sendMail() probably needs to be created in sync.js?

sendMail: async function(to, from, subject, body) {
  let wbxml = eas.wbxmltools.createWBXML(... 
  something
}

I hope someone with more experience than me is able to pick this up, because it is a problem that TB is not sending the proper responses and updates the attendance status.

bkueppers commented 2 years ago

I experience this problem also... any updates on this?

sina-4 commented 10 months ago

Any upadates please ?

rgambord commented 5 months ago

Still broken

Lorite commented 2 months ago

Hi, are there any updates? Thanks!