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

[GH-53] Accept or decline meetings from the notification message #79

Merged
merged 12 commits into from
Apr 22, 2020

Conversation

larkox
Copy link
Contributor

@larkox larkox commented Apr 8, 2020

Summary

Improve the behaviour for accepting or declining meetings, and improve the behaviour of notifications.

Ticket Link

#53

@larkox larkox requested review from levb and mickmister April 8, 2020 12:09
@larkox larkox added the 2: Dev Review Requires review by a core committer label Apr 8, 2020
levb
levb previously approved these changes Apr 8, 2020
mickmister
mickmister previously approved these changes Apr 9, 2020
Copy link
Contributor

@mickmister mickmister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @larkox! I have some non-blocking requests

server/api/post_action.go Outdated Show resolved Hide resolved
server/api/post_action.go Outdated Show resolved Hide resolved
server/mscalendar/notification.go Outdated Show resolved Hide resolved
@mickmister mickmister added the 3: QA Review Requires review by a QA tester label Apr 9, 2020
@mickmister mickmister requested a review from DHaussermann April 9, 2020 17:50
@larkox larkox dismissed stale reviews from mickmister and levb via 8a965f9 April 13, 2020 09:11
@larkox larkox requested a review from mickmister April 13, 2020 09:12
Copy link
Contributor

@mickmister mickmister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@mickmister
Copy link
Contributor

/update-branch

@levb levb requested a review from aaronrothschild April 13, 2020 14:14
@levb levb added 1: PM Review Requires review by a product manager and removed 2: Dev Review Requires review by a core committer labels Apr 13, 2020
@levb levb added this to the 0.1.0 milestone Apr 13, 2020
@aaronrothschild aaronrothschild removed the 1: PM Review Requires review by a product manager label Apr 13, 2020
@DHaussermann
Copy link

@larkox
Unless there are extra steps I'm not aware of - I'm not seeing this work.
Possibly this is not testable without #44 ? As part of that PR I can enable the bot delivering me invite notifications.
Thoughts?

@larkox
Copy link
Contributor Author

larkox commented Apr 16, 2020

@DHaussermann in order to test this:

  1. (In Mattermost) Log in to MSCalendar with account A
  2. (In Mattermost) Add a subscription (/mscalendar subscribe)
  3. (In Outlook) Create a new event with a account B, and invite the account A
  4. (In Mattermost) You should receive a message with the event, and you can answer to the invite.
  5. (In Outlook) Change any relevant information (time, subject or location)
  6. (In Mattermost) You should receive a message with the relevant change
  7. (In Outlook) Change non relevant information (attendees, attendees status, ...)
  8. (In Mattermost) You should not receive any new message
  9. (In Outlook) Create a new event with account A
  10. (In Mattermost) You should receive a new message but without the actions (you cannot answer to your own events)

@DHaussermann
Copy link

@larkox I don't see the expected for (In Mattermost) You should receive a message with the event, and you can answer to the invite. As user A

  • I see the ephemeral post confirming a subscription was created
  • I see the event invite is MS Calendar that I was invited to
  • I do not see any message in Mattermost about the event. (it is visible with viewcal)

I redeployed after the merge in from Master earlier. Please advise on further isolation steps.

@larkox
Copy link
Contributor Author

larkox commented Apr 16, 2020

@DHaussermann It feels weird. It is working for me, but just after a while after creating the subscription. It feels like sometimes MS just do not send the notification (no apparent reason). @mickmister have you encountered this before? Any idea about this?

@levb
Copy link
Contributor

levb commented Apr 16, 2020

It has happened to me several times before; but if it's happening now @DHaussermann should be able to retry; or we can do a zoom with @larkox or me and debug online.

@larkox
Copy link
Contributor Author

larkox commented Apr 16, 2020

Another side note, the subscriptions right now have a short lifetime (made bigger in a different PR if I am not mistaken). Make sure you have an active subscription by typing /mscalendar subscribe list

@DHaussermann
Copy link

@larkox Your suspicion above was correct that deliveries will not start right away. Also seem like if I wait over 15 min the subscription is gone so it was hard to see this work. (I am aware of Lev's PR to extend and renew them)

That being said maybe we could still connect on this. I can get the the event message when it is first sent but for a 1st pass - I see some other issues.

  1. Updates made by the sender did not deliver a message for a relevant detail like time change
  2. Accepting using the the drop down in the event post did not update the acceptance status on the MS Calendar side.
  3. All data about the event is enclosed with [] which are rendering in the post.
    EventMsg

@larkox
Copy link
Contributor Author

larkox commented Apr 17, 2020

@DHaussermann I tracked down several of the problems.

Updates made by the sender did not deliver a message for a relevant detail like time change

I found out that the delays also happen with the updates. You must see a call in ngrok (or any other traffic log of the server) to /plugins/com.mattermost.mscalendar/notification/v1/event. If you do not see this, is because Microsoft has not send the notification yet.

Accepting using the the drop down in the event post did not update the acceptance status on the MS Calendar side.

The first one should be accepted. Subsequent changes are not accepted due to Microsoft changing the id of the event. The only solution for this would imply several changes and bad user experience in my opinion, so I will make so once you have decided something, you cannot change it in Mattermost.

All data about the event is enclosed with [] which are rendering in the post.

The formatting of these messages is not on the scope of this PR.

…o an event after responding with post action
@codecov-io
Copy link

Codecov Report

Merging #79 into master will increase coverage by 0.40%.
The diff coverage is 60.97%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #79      +/-   ##
==========================================
+ Coverage   25.31%   25.71%   +0.40%     
==========================================
  Files          61       62       +1     
  Lines        2303     2329      +26     
==========================================
+ Hits          583      599      +16     
- Misses       1654     1664      +10     
  Partials       66       66              
Impacted Files Coverage Δ
server/mscalendar/mscalendar.go 100.00% <ø> (ø)
server/utils/slack_attachments.go 0.00% <0.00%> (ø)
server/mscalendar/notification.go 52.74% <69.44%> (+1.95%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4cd92a...03dac02. Read the comment docs.

@larkox larkox linked an issue Apr 17, 2020 that may be closed by this pull request
@DHaussermann
Copy link

@larkox I'm afraid I don't have much info to add about these 2 issues.

  1. Regarding no message about event updates, I don't see any activity like what you described on my server when I'm waiting for the DM.

  2. Regarding the attendance status, I am selecting the affirmative option of Yes in the drop down and I still see RSVP as the state in Outlook. I have waited sevral minutes for the update to take place.

I am also noticing another issue which may be the same as what I'm seeing in 1. For some reason, only the 1st event invite is delivering an event to me in a DM. In the past I saw this and assumed it was caused by the subscription time to live. But, now I think I'm seeing an issue which may also explain why I'm not getting event updated DMs. Can you try and repo this...
Steps:

  • As User A Create a subscription
  • Wait 5 min to ensure the subscription is working (this was discussed above - not sure if I need to create a separate issue for this delay)
  • As User B invite User A to an event from outlook
  • Wait a few seconds and note that User A has received a DM with event details
  • As User B invite User A to another event from outlook
  • Use /mscalendar subscribe list to confirm subscription is still in place.
    Expected: 2nd event delivered in a DM
    Observed: No DM received after 2nd invite

Please advise on next steps for this. Maybe we could set a time to connect if we aren't seeing the same results.
Also curious about your thoughts on if any of these issues seem as thought they may be related to bugs already fixed in master.

@levb
Copy link
Contributor

levb commented Apr 20, 2020

@DHaussermann Sorry for a superficial comment in a hurry. I think only some of the event updates trigger subscription messages in MSGraph. I am 100% sure that changing the time of the event does, but I am pretty sure that editing the details does not. Have not looked for the detailed documentation on what changes are broadcast.

@DHaussermann
Copy link

@larkox just a heads-up I'll need to redeploy and test this again. I'll let you know if I see any change.

@larkox
Copy link
Contributor Author

larkox commented Apr 21, 2020

@DHaussermann I found the error with the reply to the events. It should be fixed now. It might be related to the other error of new events not showing, but I am not really sure about that. It feels like notifications come from Microsoft at different speeds (I made one event, received nothing, I made a second event, received the second, and shortly after I received the first). There is not much we can do on that front, apparently. Nevertheless, it is working on my end, so whenever you are going to give it another run, ping me and I can see if there is anything different in your environment that might make this happen.

@DHaussermann
Copy link

DHaussermann commented Apr 21, 2020

@larkox I have tested this again.
I now see the behavior where accept the ephemeral post now updates and the status is reflected in MS Calendar. 🎉

Yes I am also seeing that the events DMs are no delivered reliably. If I create several invites in a row, they are not delivered at the same time or chronologically.

~~I still have not seen a DM for an event update though. ~~

@DHaussermann
Copy link

@larkox quick follow-up I do see updates working! They were all delivered at once about 10 minutes later.

Last question on this PR - Selecting anything other than Yes for attendance satus does not work. I believe this is out of scope. correct?

Copy link

@DHaussermann DHaussermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and passed
I believe everything in the scope of this PR is now working.

  • Event invite are received
  • Event updates are received
  • All acceptance statuses can be used successful and are correctly reflected in MS Calendar
  • There is one reaming issue that acceptance status cannot be changed afterwards. @larkox has provided an explanation

The first one should be accepted. Subsequent changes are not accepted due to Microsoft changing the id of the event. The only solution for this would imply several changes and bad user experience in my opinion, so I will make so once you have decided something, you cannot change it in Mattermost.

I have created #91 to follow-up on possible solutions for this.

LGTM!

@DHaussermann DHaussermann added 4: Reviews Complete All reviewers have approved the pull request QA Review Done PR has been approved by QA and removed 3: QA Review Requires review by a QA tester labels Apr 21, 2020
@larkox larkox merged commit 6039ba6 into mattermost:master Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request QA Review Done PR has been approved by QA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accept/Decline a meeting invite in a chat window
7 participants