facebook: url link shared from scopes cannot show up in post message page

Bug #1549156 reported by Zhang Enwei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Confirmed
Medium
David Barth
The Webapps-core project
Confirmed
Medium
Alexandre Abreu
webapps-sprint
Confirmed
Medium
Alexandre Abreu

Bug Description

Description:
In scopes, we can share image or video link to facebook, or other apps through content hub.
While it seems facebook is not properly handling this since I cannot see the link in post message page.

Steps:
1. compile and install latest dianping scope https://code.launchpad.net/~hanloon-team/hanloon/dianping
2. compile and install unity 8 MP from ken: https://code.launchpad.net/~ken-vandine/unity8/share_data_uri_string/+merge/286676. This MP is to fix https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1549056
3. open 点评
4. open one item in preview
5. share the image to facebook(webapp)

Revision history for this message
Zhang Enwei (zhangew401) wrote :

this is log from content hub.

David Barth (dbarth)
Changed in webapps-sprint:
milestone: none → sprint-19
assignee: nobody → Alexandre Abreu (abreu-alexandre)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

I think the Facebook app is making the assumption the image is a local file, and doesn't handle when the image is remote.

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

@Ken: yes it does, ... but I would have assumed (wrongly I guess) that the content hub would have handled the download to hand a local resource (as it usually does) to the other party in the transcation, ... it seems to break the "contract" in a way if the content type is set to "pictures",

Changed in webapps-core:
status: New → Confirmed
assignee: nobody → Alexandre Abreu (abreu-alexandre)
importance: Undecided → Medium
Changed in webapps-sprint:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

@Ken: when I say "yes it does" one should read "yes it does make this assumption",

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

After digging up a bit more, even with Ken's MP share-data as a feature with plain http URIs is currently not working at all because of various issues (not related to webapps):

- webapps do not deal with the downloading part of the job, nor do they really rely on the image to be local, they rely instead on the toDataURI function of the ContentItem being handed to them during the transfer:

http://bazaar.launchpad.net/~phablet-team/content-hub/trunk/view/head:/import/Ubuntu/Content/contentitem.cpp#L135

this function does not deal with non local URIs,

- unity8 by default treats all share-data for scopes previews with a URI not starting with file:// (e.g. not local), as an external one, and overrides the content-type to 'Links' instead of pictures,

http://bazaar.launchpad.net/~unity-team/unity8/trunk/view/head:/qml/Dash/Previews/PreviewSharing.qml#L60

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

so scopes with share-data and http:// URIs is not supported atm contrary to what is being said in the docs:

https://developer.ubuntu.com/api/scopes/cpp/sdk-15.04.1/previewwidgets/#contentsharing

Revision history for this message
Zhang Enwei (zhangew401) wrote :

Thank you Alexandre.
But during my test, with Ken's MP, the picture uri from scope can be passed to Message and Twitter. Only Facebook failed.

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

@Zhang yes, but for twitter only the link was posted (there is a bug for facebook link sharing https://bugs.launchpad.net/webapps-core/+bug/1550042)

Changed in webapps-sprint:
status: Confirmed → In Progress
Changed in webapps-core:
status: Confirmed → In Progress
Revision history for this message
Zhang Enwei (zhangew401) wrote :

Hi Alexandre,
I consulted with Ken about this behaviour.
My question:
I tried to select sharing to twitter(webapp) and message, the link can be passed to the target app. It is the link as text being passed, not the image, I want to ask if this is the correct behaviour?
Ken's answer:
"Yes, this is the correct behavior. If the image is local, a copy of the image will be sent to the destination app. If the file is remote (url) it will just pass along the url, it's up to the destination app to know what to do with it."

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

@Zhang: yes this is what I explained above, and what you see in the twitter webapp, what is being posted is the link,

Until we tweak the behavior, images referenced by http:// URLs are shared as links by unity8

Revision history for this message
Zhang Enwei (zhangew401) wrote :

Understood, thank you Alexandre.

Revision history for this message
Paweł Stołowski (stolowski) wrote :

The logic responsible for this is http://bazaar.launchpad.net/~unity-team/unity8/trunk/view/head:/qml/Dash/Previews/PreviewSharing.qml#L60

Every uri that doesn't start with file:// or "/" is considered external. And there is a comment in the code saying " for now, treat all external urls as Links, or it will break contenthub"

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

@Pawel: thank you, yes as I said in an earlier comment :)

The feature feels is broken as a whole:

- The intent is to share a picture but it is being coerced as links sharing to the end app,
- I am not sure that from the content hub sharing's perspective end apps are expected to be handed out external (http based) resources and download them (it obviously doesn't work anyway), what is the advertised semantics?
- When sharing online resources, one must also think about adding context to the URI (most importantly credentials if any, possibly others like UA string, etc.), the question of credentials sharing is sensitive, as we dont want to leak any (unless specifically ack'd by the user to the end app),
- When sharing online resources and handing it off to an app, one must take into account the http response's meta info: file name, content type, etc. which we might want to let every app handle,

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

Not sure what to do about this one, adding "Canonical System Image" so that it can be prioritized

Changed in webapps-core:
status: In Progress → Confirmed
Changed in webapps-sprint:
status: In Progress → Confirmed
Changed in canonical-devices-system-image:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → David Barth (dbarth)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.