Fallback image not shown when no image specified

Bug #1531913 reported by dobey
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Medium
Michał Sawicz
unity-scopes-api (Ubuntu)
Fix Released
High
Michi Henning
unity8 (Ubuntu)
Fix Released
Medium
Albert Astals Cid

Bug Description

In fixing bug #1520631 in unity-scope-click, as the store server will start allowing uploads with no icon specified, it was discovered that Unity8 is not showing the fallback when we do not include the artwork. Instead, it is only shown if we specify invalid artwork. This seems wrong, and instead I would think the fallback would be displayed whenever no other artwork is provided.

Related branches

Revision history for this message
Albert Astals Cid (aacid) wrote :

Doing that will make it not possible to actually specify a blank artwork if we ever want one.

Whether that is useful or not I don't know :D

Revision history for this message
Albert Astals Cid (aacid) wrote :

Doing that will make it not possible to actually specify a blank artwork if we ever want one. -> if we specify a fallback image

Michał Sawicz (saviq)
Changed in unity8 (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Albert Astals Cid (aacid)
Revision history for this message
Albert Astals Cid (aacid) wrote :

I guess you can detect that your sending us an empty image, why not send the fallback image directly instead of an empty image and waiting for us to replace that with the fallback?

Revision history for this message
dobey (dobey) wrote :

Specifying a blank artwork is still possible, and still not sensible. One can always specify a 1x1 transparent image as the artwork for intentionally blank space. :)

We don't detect that we are sending an empty image. We just specify the fallback and expect it to work as a fallback should. If a fallback is not shown when no artwork is passed, then it's not a fallback. If it's the image to be shown when there is an error loading the image, then the API is wrong, because developers might want to show something else in case of error, so that it's known there was an error. Changing the scope to do the work would mean duplicating code and logic. Why should we have to specify the image that we want to fall back to, in two completely different ways, in the same code?

Revision history for this message
dobey (dobey) wrote :

Oh, and one can also define a different CategoryRenderer JSON for cards where one actually wishes to have a blank image, which does not include the fallback. Showing the fallback when specified and the artwork is empty, does not change that. That is how one should be doing intentionally blank results anyway.

Changed in canonical-devices-system-image:
assignee: nobody → Michał Sawicz (saviq)
importance: Undecided → Medium
milestone: none → backlog
status: New → Confirmed
Revision history for this message
Albert Astals Cid (aacid) wrote :

> If it's the image to be shown when there is an error loading the image, then the API is wrong,
No, it is exactly that. That is the reason why fallback was introduced for, in case the art image fails to load (server is overloaded, resource is gone, etc) and then we show a fallback.

It is documented like that as you can see in https://developer.ubuntu.com/api/scopes/cpp/sdk-15.04.1/md__r_e_l_e_a_s_e__n_o_t_e_s/ "This allows a scope to specify a category-specific fallback image in case the artwork for a result cannot be retrieved."

You can argue that a blank URI can not be retrieved and thus the fallback needs to be loaded. My argument is that a blank URI says "no retrieval needed", so it is not an error and no fallback is needed.

I'll implement what you're asking for and let others decide if it needs to be merged or not.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

yeah... I tend to agree that the fallback should be loaded if the specified artwork fails to load. if the scope returns a empty icon, that won't produce a failure. The dash can display what the scope requested just fine. No need for a fallback.

I totally get Rodney's point too, in the end it's probably a matter of preference. The more flexible approach to me seems to be what the dash currently does, allowing to specify no icon. Returning a 1x1 empty icon is certainly more of a hack.

Revision history for this message
Albert Astals Cid (aacid) wrote :

The new code is at https://code.launchpad.net/~aacid/unity8/fallback_for_empty/+merge/282002

I still disagree with this solution and with Rodney expectation of what the fallback image does given how the API is documented, but it's not my call to decide if this goes in or not.

Changed in unity8 (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Michał Sawicz (saviq) wrote :

Ultimately it's the call of whoever wrote the API and what was their intention. I tend to agree that the fallback is only meant to deal with cases where the scope can't do anything about it. When sending empty, it might very well send the fallback URL instead.

What's the argument against the above? Maybe it's API and/or docs that need to be amended to make it more clear?

I'm not saying no, but it's not our decision alone.

Changed in unity8 (Ubuntu):
status: In Progress → Opinion
Revision history for this message
Michi Henning (michihenning) wrote :

The intention was that a scope can specify a specific fallback image. That image should be shown when the normal image load returns an error or an empty image (zero-length ByteArray, or whatever type it is).

This allows the scope to specify a specific fallback image that might be needed to keep style/theming for the scope. If the scope doesn't provide a fallback image, or loading of the specified fallback image fails, the shell can substitute some generic fallback image.

That was the thinking at the time we added this feature.

What's the problem with doc? If it isn't right, I'll fix it.

Revision history for this message
Michał Sawicz (saviq) wrote : Re: [Bug 1531913] Re: Fallback image not shown when no image specified

W dniu 17.01.2016 o 16:06, Michi Henning pisze:
> What's the problem with doc? If it isn't right, I'll fix it.

The question is whether fallback was supposed to be used when the scope
did not send a url for the image, vs. if whatever it did send failed to
load.

Revision history for this message
Michi Henning (michihenning) wrote :

If the card requires an image and the scope doesn't provide one, the fallback should be shown.

If the scope does specify an image, but it doesn't load, the fallback should be shown too.

That makes the most sense to me.

Changed in unity-scopes-api (Ubuntu):
assignee: nobody → Michi Henning (michihenning)
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Michi Henning (michihenning) wrote :

I've pushed an MR with the doc update for scopes API here:

https://code.launchpad.net/~michihenning/unity-scopes-api/doc-fix/+merge/283001

Changed in unity-scopes-api (Ubuntu):
status: Confirmed → In Progress
Changed in unity8 (Ubuntu):
status: Opinion → In Progress
Changed in unity-scopes-api (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity8 - 8.11+16.04.20160212-0ubuntu1

---------------
unity8 (8.11+16.04.20160212-0ubuntu1) xenial; urgency=medium

  [ Albert Astals Cid ]
  * Do not use components in card creator generated code
  * Forward the makesurevisible signal from the inner preview widget
  * Make fallback also be fallback when the image is empty and not only
    on error (LP: #1531913)
  * Make the artShapeSize assignment be updated when using dynamic grid
    units
  * Visual improvements to the dash audio play cards
  * We don't use the unity-scope-scopes anymore (LP: #1439172)

  [ Andrea Cimitan ]
  * only request a bigger image if zoomable widget data property is
    true, otherwise just leave the screen size (LP: #1536814)

  [ CI Train Bot ]
  * Update translation template

  [ Daniel d'Andrada ]
  * Set initial surface size (LP: #1532974)

  [ Daniel d'Andrada, Michał Sawicz ]
  * Window Size Hints

  [ Florian Boucault ]
  * Splash screen: delay showing the ActivityIndicator by 2 seconds.

  [ Lukáš Tinkl ]
  * Replace the word "phone" with a more generic term "device" in the
    welcome wizard (LP: #1294732, #1543527)

  [ Michael Terry ]
  * Have the tablet greeter set appropriate OSK hints if the user has a
    passcode instead of a passphrase. (LP: #1544173)

  [ Michael Zanetti ]
  * Don't eat mouse events in the edgebarrer

  [ Michał Sawicz ]
  * Bump unity-api dependencies

  [ Nick Dedekind ]
  * Added support for secondary indicator actions (LP: #1398888)
  * Remove zombie if they're not animated. (LP: #1534541)
  * Removed unused panel resources

  [ Ted Gould ]
  * Start the indicators after Unity8 starts instead of before

 -- Michał Sawicz <email address hidden> Fri, 12 Feb 2016 00:12:41 +0000

Changed in unity8 (Ubuntu):
status: In Progress → Fix Released
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
status: Confirmed → Fix Committed
Changed in unity-scopes-api (Ubuntu):
status: Fix Committed → Fix Released
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
milestone: backlog → 13
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
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.