mattermost / mattermost-plugin-mscalendar

Mattermost plugin for Microsoft Office365
Apache License 2.0
14 stars 22 forks source link

MS Graph error is shown when selecting acceptance #129

Closed DHaussermann closed 4 years ago

DHaussermann commented 4 years ago

When testing on a recent build from master I see an ephemeral post with the text Error: Failed to respond to event: msgraph Accept Event: 202 Accepted:

When this occurs I notice that the selected status has in fact been updated in MS Calendar. I was curious if something was misconfigured with MS Graph permissions but I see this consistently with multiple users on different servers where I'm sure the Azure app what not doing this on older builds.

(running master build https://github.com/mattermost/mattermost-plugin-mscalendar/commit/0013cc5c33a7ec3d89a54cbe3e27352d229c6818)

MSGraphError

Steps:

larkox commented 4 years ago

This is due to the client returning an error when the http status is 202. This was dealt with checking for a prefix of 202 on the error, but changes in how we deal with errors have made this to stop working.

Easy solution would be to change the "hasPrefix" checks for "contains", but not sure how robust that solution would be.

mickmister commented 4 years ago

This is due to the client returning an error when the http status is 202

Very strange how the client returns an error in this case. The hasPrefix must have stopped working because I added the msgraph ... prefix (which has actually come in handy multiple times already, but it broke some logic here obviously). strings.Contains(err.Error(), "202 Accepted") should be fine.