Open jorgk3 opened 1 year ago
@jorgk3 We are unable to repro this issue. We need more information to investigate further-
Thanks for the quick reply. I'll see whether I can dummy-up the calls to our local decryption server and supply a full add-on that reproduces the issue.
As for the questions:
Creating the dummy was easier than I thought: https://github.com/jorgk3/OfficeDevPrivate/blob/main/planckForOLWeb.zip So click on the first message, run "planck for Outlook web" from the "three dots" menu, then select a different message and do the same. Check output in the browser console. @exextoc invited to the private repo.
@jorgk3 Thanks for sharing the repo. We are still unable to repro the bug. Can you please share a video of the bug so that we can confirm the behaviour?
Here you go. Please compare the console output with the code.
You will notice that the dialogue is only populated after 2 seconds when the timeout triggers.
Are you saying that when you run the sample, it behaves differently?
@jorgk3 We are able to repro the issue now. It has been put on our backlog. We, unfortunately, have no timelines to share at this point. Internal tracking id: Eg: Office: 215905
I experienced the same issue, it would be good to know when this can be fixed
I am also experiencing the same issue.. I can't seem to find backlogitem 215905, what is the current status?
Same here, nothing I try works. Event tried to log some incoming messages to parent with
const listener = (event) => {
if (event.data) {
const data = JSON.parse(event.data);
if (data && 'dialogMessage' in data) {
console.log(data);
}
}
};
window.addEventListener('message', listener, false);
This code works in Outlook for Mac on desktop as a workaround that Office.EventType.DialogMessageReceived
event is not recived on dialog object but does not work on Office online.
messageParent
does not return any errors for me.
listener was added to both iframe and top window
Any updates @exextoc? This issue is waiting since Jully. Current state of things does not allow user to login through dialog like recomended in documentation.
Ok I know what problem partially is and have workaround for anyone who want to use it.
As for the problem it is that in outllok on desktop event that is sent to addin is in form of an stringlified JSON with dialogMessage
field but in case of OWA it is sent as plain text exacly as sent throught messageParent
.
const listener = (event: MessageEvent) => {
if (event.data) {
console.debug(event);
try {
const data = JSON.parse(event.data) as object;
if (data && 'dialogMessage' in data) {
const dialogMessage = data.dialogMessage as { messageContent: string };
const messageContent = dialogMessage.messageContent;
if (messageContent) {
this.handleMessageContent(messageContent);
} else {
console.error('no message content');
}
this.closeAndClearDialog(); //we need to manually close the dialog so save instance of it in some property
}
} catch (err) {
console.debug('dialogMessage is not an object');
const data = event.data as unknown;
if (typeof data === 'string') {
if (data) {
this.handleMessageContent(messageContent);
this.closeAndClearDialog(); //we need to manually close the dialog so save instance of it in some property
} else {
console.error('no message content');
}
}
}
}
};
window.addEventListener('message', listener, false);
@jorgk3 We are investigating this issue, but this add-in is no longer available. We are unable to reproduce this issue without the add-in, can you please share the sample add-in so that we can look into this.
this add-in is no longer available
What is no longer available? See https://github.com/OfficeDev/office-js/issues/3463#issuecomment-1609008464
@jorgk3 we are able to repro the issue and are working on resolving it.
I'm developing an add-on for mail decryption. The "mainline" of the add-in communicates with a local decryption server, then displays the result in a dialogue window. I found that
Office.context.ui.messageParent()
doesn't trigger the listener in the add-on mainline reliably. It works the first time when selecting and decrypting the first message, but not on any subsequent messages.Here's the code:
Mainline:
Dialog code:
Here's a screenshot of all the debugging output when it works:
Here's a screenshot of the debugging output when it doesn't work.