Open GirtsJermacans opened 2 weeks ago
Could you please confirm if you get the same response for every image copied from different sources? As per a repro we had, sometimes we do get src attribute as well.
We are also facing similar issues from past couple of days. Our add-in is also relying on getAsync
to get body. But now for inline attachments it has originalsrc
only which is causing issues for our add-in as well.
Confirming the same issue for us. Since originalsrc
only returns the cid
(which we can't support in our add-in), it means that inline images aren't processed well anymore, leading to potential data loss. Could this please be looked into as soon as possible?
@geoffreyreemer @gauravsoni119 @GirtsJermacans Could you please share how are these images or attachments added to body in your cases. I was able to repro the issue but only sometimes. Looking for any recent change that might have broken this but meanwhile knowing the source of attachments in your cases would help
@mmanjaree-msft Just checked on Environment B following ways to add inline images. For the following scenarios, the body is missing src attribute:
For the following scenarios, the body has src attribute
Img tag example for the above 2 scenarios:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdUAAAEHCAYAAAD4T9zTAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFxEAABcRAcom8z8AAP+lSURBVHhebL0FlF/V9b89E5+4ezLRmehk4u7uIY7T4FacIsUpxQqUIi1OoVAoxVqgeKGlFEpxd5dAAjFCsP0+z87crPT3/r9r3XXv994j+9j+nL3PPvuUlJTsEyW19o2SntybcpXw3JV725rntjX/....... and so on...." id="image_0" style="max-width: 424px;">
I think this covers all the possible scenarios, how to add inline image. Will confirm a bit later today if the Environment C, has the same outcomes.
@geoffreyreemer @gauravsoni119 @GirtsJermacans Could you please share how are these images or attachments added to body in your cases. I was able to repro the issue but only sometimes. Looking for any recent change that might have broken this but meanwhile knowing the source of attachments in your cases would help
@mmanjaree-msft we have similar steps mentioned by @GirtsJermacans. While composing, use 'Insert - Pictures' and select the image.
@mmanjaree-msft Just checked on Environment B following ways to add inline images. For the following scenarios, the body is missing src attribute:
- Add as attachment, then move into message body.
- Open file directory, single click on image, copy it and paste it into the body.
- Use some snipping tool - create a snip, paste it into the body.
- Select following - 'Insert - Pictures' and select the image (it should add it to the body)
For the following scenarios, the body has src attribute
- Create a signature, compose new mail, insert signature to the body, click send.
- Create a signature, select it to appear automatically on compose new mail, compose new mail, click send.
Img tag example for the above 2 scenarios:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdUAAAEHCAYAAAD4T9zTAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFxEAABcRAcom8z8AAP+lSURBVHhebL0FlF/V9b89E5+4ezLRmehk4u7uIY7T4FacIsUpxQqUIi1OoVAoxVqgeKGlFEpxd5dAAjFCsP0+z87crPT3/r9r3XXv994j+9j+nL3PPvuUlJTsEyW19o2SntybcpXw3JV725rntjX/....... and so on...." id="image_0" style="max-width: 424px;">
I think this covers all the possible scenarios, how to add inline image. Will confirm a bit later today if the Environment C, has the same outcomes.
Checked - Environment C has the same results.
We have the bug in our backlog. We haven't root cause or any eta to share at this point. Internal tracking id: 5054071
Provide required information needed to triage your issue
We've been processing body of
coerciontype 'html'
returned fromitem.body.getAsync
when sending new mail item. If inline images are included, then up until now, the method call would always return a body withimg tag
that containssrc attribute
in it. Thesrc attribute
as well asimg tag
would differ slightly, depending on the platform and how the inline image is added to the message, however attribute itself would always be present.Just recently, without a specific reason, for Environment B and Environment C (see below), and potentially other environments,
item.body.getAsync
started to returnimg tag
withoutsrc attribute
in it, therefore without some of the data usually associated with it.This is causing issue to process the body correctly.
I have seen this issue for mac, but it seems that it does not relate to the issue described above.
Your Environment
3 different environments
Environment A:
Environment B:
Environment C:
Expected behavior
Calling
item.body.getAsync
returns html body with image tag, that hassrc
andoriginalsrc
attribute in it. See below example for Environment A:Current behavior
For Platform B and C, calling
item.body.getAsync
returns html body with image tag, that has only 'originalsrc' attribute in it. See below example for Environment B and C:With this behavior, it is not possible to identify, for example, which attachment it is when getting attachments using
item.getAttachmentsAsync
method call.Src attribute
containsid
, which has 1 to 1 relation withid
property onOffice.AttachmentDetailsCompose
type. In some cases, it also has attachment content itself, which is a workaround for this [issue].(https://github.com/OfficeDev/office-js/issues/5031). Additionally, consistency is helpful, when processing data.Steps to reproduce
item.body.getAsync
of coerciontype 'html'. You will get html body withimg tag
that has nosrc attribute
in it.Context
Our Addin processes information provided by the html body, including the inline attachments, performs some checks on it, and then creates a modified html body based on that information.# It is important to match up the inline image on the html body, with what is returned from
item.getAttachmentsAsync
. Getting back justcid
inoriginalsrc
has no relation to any of the ids that are available onOffice.AttachmentDetailsCompose
interface, essentially making that inline attachment unknown to the rest of the app. Up until now, src attribute always returned just enough to be able to work with it, however now for Environment B and C, it simply started to give back this different body. It could be that this is happening in other environments, and is not related just these specific ones.Useful logs
We use
@types/office-js version 1.0.401
. Here is example code how to get html body: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.