PurpleTurtleCreative / completionist

Asana integration plugin for WordPress.
https://purpleturtlecreative.com/completionist/
GNU General Public License v3.0
1 stars 0 forks source link

Warning about YouTube videos in Asana task attachments not supported #145

Closed MichelleBlanchette closed 1 year ago

MichelleBlanchette commented 1 year ago

I don't know why the YouTube video is even showing up as a task attachment. I haven't investigated this further, but I suspect it's because the YouTube video is included in the task description as an inline attachment that isn't being properly removed during server-side processing. The server-side processing is supposed to remove inline attachments from the task's attachments array. Only non-inline attachments should be included in the remaining attachments array.

Console warning: Screenshot 2023-05-29 at 12 58 59 PM

Console warning attachment data example:

{
    "download_url": null,
    "host": "external",
    "name": "https://www.youtube.com/watch?v=96sq4aMPB8s&ab_channel=GoPlacesPro",
    "view_url": "https://www.youtube.com/watch?v=96sq4aMPB8s&ab_channel=GoPlacesPro",
    "_ptc_view_url": "http://localhost/wp-json/completionist-pro/completionist/v1/attachments?token=ffb83c32d16d48c9bc0291a3210a0b1f"
}
MichelleBlanchette commented 1 year ago

This was fixed by ca98a02ef4a365e0deb781f1710e59c9ea33dba6

It had to do with fixing the regex to allow for <object> tags with attributes (previously expected no attributes) and then decoding HTML entities to ensure the parsed URLs matched during comparison.