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

Outlook getSelectedItemsAsync does not populate conversationId in results #4974

Open
maoueh opened this issue Oct 15, 2024 · 5 comments
Open
Assignees
Labels
Area: Outlook Issue related to Outlook add-ins Type: product feature request Office JS ideas that should be posted to aka.ms/m365dev-suggestions (formerly User Voice.)

Comments

@maoueh
Copy link

maoueh commented Oct 15, 2024

In issue #4960 (comment), it was suggested to use Office.context.mailbox.addHandlerAsync(Office.EventType.SelectedItemsChanged, () => { ... }) and getSelectedItemsAsync to overcome the fact that ItemChanged is fired only for a pinned taskpane.

However, the getSelectedItemsAsync seems to be bogus by not populating the conversationId field of the selected items.

Your Environment

  • Platform: Mac
  • Host: Outlook
  • Office version number: 16.89.3 (24092813)
  • Operating System: macOS

Expected behavior

With an Outlook extension that defines a taskpane which has multi-select APIs enabled, use the following code:

  Office.onReady(() => {
    console.log('Init after Office Ready', Office.context.mailbox.diagnostics.hostName)

    Office.context.mailbox.addHandlerAsync(Office.EventType.SelectedItemsChanged, () => {
      console.log('[Outlook] SelectedItemsChanged event')
      Office.context.mailbox.getSelectedItemsAsync(result => {
        if (result.error) {
          console.error('Error getting selected items', result.error)
          return
        }

        console.log('[Outlook] SelectedItemsChanged result count', result.value.length)
        result.value.forEach(item => {
          console.log(`[Outlook] - Item ${item.itemId} - Conversation ID ${item.conversationId}`)
        })
      })
    })
  })

When the selection changed, you will see the following logs:

[Log] Init after Office Ready – "Outlook" (index.tsx, line 22)
[Log] [Outlook] SelectedItemsChanged event (index.tsx, line 24)
[Log] [Outlook] SelectedItemsChanged result count – 1 (index.tsx, line 30)
[Log] [Outlook] - Item AAMkA...QQKOAAA= - Conversation ID undefined (index.tsx, line 32)
[Log] [Outlook] SelectedItemsChanged event (index.tsx, line 24)
[Log] [Outlook] SelectedItemsChanged result count – 1 (index.tsx, line 30)
[Log] [Outlook] - Item AAMkA...QS4FAAA= - Conversation ID undefined (index.tsx, line 32)
[Log] [Outlook] SelectedItemsChanged result count – 2 (index.tsx, line 30)
[Log] [Outlook] - Item AAMkA...QQKNAAA= - Conversation ID undefined (index.tsx, line 32)
[Log] [Outlook] - Item AAMkA...QS4EAAA= - Conversation ID undefined (index.tsx, line 32)

Current behavior

The conversationId is undefined always when receiving the results back from the getSelectedItemsAsync.

It should be populated.

Steps to reproduce

  1. Implement an Outlook Add-In with a taskpane and multi-select permissions.
  2. Use the code provided above
  3. Select messages in the inbox
  4. Inspect the printed logs and observe that conversationId is undefined.

Provide additional details

It appears this could be a bug with the Outlook native client only (maybe just on OSX too). Indeed, I've performed the same test using Outlook for Web and there, the conversationId field is properly populated.

Context

Trying to overcome the limitation that ItemChanged which is emitted only for pinned taskpane even though our taskpane even when not pinned is still visible and as such, doesn't react to user changing messages.

We worked around the current issue by using itemId and retrieving the message in question and finding its conversationId. This is incurring extra calls in the backend as the itemId here is a mutable ID so we need in the backend to first convert to immutable ID (which we store internally for messages) via a Graph API call to TranslateExchangeIds to make the mutable itemId immutable and perform the lookup correctly.

Useful logs

See logs above, see following screenshots which is my test session.

image

Thank you for taking the time to report an issue. Our triage team will respond to you in less than 72 hours. Normally, response time is <10 hours Monday through Friday. We do not triage on weekends.

@neprasad-microsoft
Copy link

@maoueh
Just to confirm, are you saying that it works as expected on Outlook Web, but not on Mac?

@exextoc exextoc added Needs: attention 👋 Waiting on Microsoft to provide feedback Area: Outlook Issue related to Outlook add-ins and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Oct 15, 2024
@exextoc exextoc self-assigned this Oct 15, 2024
@maoueh
Copy link
Author

maoueh commented Oct 15, 2024

@neprasad-microsoft Correct.

@maoueh
Copy link
Author

maoueh commented Oct 15, 2024

When I say Mac, just to be clear I'm talking about the native Outlook Mac app

@maoueh
Copy link
Author

maoueh commented Oct 15, 2024

I hadn't the chance to test native Outlook Windows app yet.

@neprasad-microsoft
Copy link

Hi @maoueh
My apologies for the confusion. 'conversationId' is a part of API set 1.14 which is not yet supported on Mac. This is in our Feature backlog, but unfortunately, we do not have any timeline for this. Thanks for your patience.

@neprasad-microsoft neprasad-microsoft added Type: product feature request Office JS ideas that should be posted to aka.ms/m365dev-suggestions (formerly User Voice.) and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Outlook Issue related to Outlook add-ins Type: product feature request Office JS ideas that should be posted to aka.ms/m365dev-suggestions (formerly User Voice.)
Projects
None yet
Development

No branches or pull requests

3 participants