Closed arturs-buls closed 5 months ago
Thanks for reporting the issue , can you please share the repro video for this issue which will help in reproing this issue ??
@exextoc Thanks for the response. Attached video with minimal reproduction to my report so it would be pinned in top.
Small breakdown:
On ItemChanged event I log subject of Office.context.mailbox.item
. Also I launch setTimeout
to log out subject of current item (in hopes of that at some point Office.context.mailbox.item
will contain actually selected item). Both of them show event data instead of email one.
In console log you can observe that ItemChanged
is fired immediately for email, but for event there is slight delay, so event one is fired after email one.
When Adding category - current item is actually updated.
Our users don't click on buttons to add category, it is async and automatic process on ItemChanged
, so we don't have real workaround to prevent unnecessary tags from adding
Thanks for reporting this issue. It has been put on our backlog. We unfortunately have no timelines to share at this point
Internal tracking id: 200766
If user is scrolling through their email (for example - using arrow keys) and stop on some email - there are chances that Addin will get out of sync from
Office.context.mailbox.item
and will show Event data instead of current email. At the same time - if you callOffice.context.mailbox.item.categories.addAsync
it will actually add category to correct current item.Provide required information needed to triage your issue
Your Environment
Expected behavior
Office.context.mailbox.item
should contain currently opened mail item. This if that will be fixed - we will be able to validate if current item does actually match the one passed into event listener.Current behavior
Office.context.mailbox.item
may be not aligned with actually opened mailbox itemSteps to reproduce
Use following this Gist
Setup: Get event invitation and email into Inbox folder. Steps to reproduce
Link to live example(s)
https://gist.github.com/arturs-buls/38798020de8432ad0ff651150fc44476
Provide additional details
See steps to reproduce. Important part is that sidebar should be pinned
Context
In our case this is causing issue of setting categories to wrong items. Since sidebar is not detecting any new items - it is analyzing event, makes decision to add category, but category gets added to other mailbox item.
After some testing I found out that
Office.EventType.ItemChanged
event hander is fired with some delay for invitations, but it is fired immediately for email, causing race condition. Didn't find any workaround (tried to usesetInterval
to monitorOffice.context.mailbox.item
on my own, but it seems that internal state of office.js has wrong value as well).Useful logs
Video with reproduction
https://user-images.githubusercontent.com/20514322/229431474-7501c39d-1cff-4530-9780-88a86280b116.mp4