Closed Bug 1027347 Opened 10 years ago Closed 10 years ago

downloadError on individual app should not always be an error object

Categories

(Core Graveyard :: DOM: Apps, defect)

x86
macOS
defect
Not set
normal

Tracking

(blocking-b2g:2.0+, firefox31 wontfix, firefox32 fixed, firefox33 fixed, b2g-v2.0 fixed, b2g-v2.1 fixed)

RESOLVED FIXED
2.0 S5 (4july)
blocking-b2g 2.0+
Tracking Status
firefox31 --- wontfix
firefox32 --- fixed
firefox33 --- fixed
b2g-v2.0 --- fixed
b2g-v2.1 --- fixed

People

(Reporter: jlal, Assigned: jlal)

References

Details

(Whiteboard: [systemsfe])

Attachments

(1 file, 3 obsolete files)

I think the intent here should be .downloadError contains the last error for that particular app if there was an error downloading. The current logic https://mxr.mozilla.org/mozilla-central/source/dom/apps/src/Webapps.js#435 is always return a download error but the name is blank if there was no error.
Assignee: nobody → jlal
Blocks: 1027935
James - Should this be marked as 2.0+ given that this blocks bug 1027935? If so, can you nom this for 2.0?
Flags: needinfo?(jlal)
blocking-b2g: --- → 2.0?
Flags: needinfo?(jlal)
blocking-b2g: 2.0? → 2.0+
Whiteboard: [systemsfe]
Try:

https://tbpl.mozilla.org/?tree=Try&rev=7f68d1f91d65

I did a potentially sketchy thing which is update state on the child process side for the downloadError during our success events... This has a big upside which is we don't need to explicitly clear the error all over in Webapps.jsm (I still clear there but for the beginning of downloads)
Updated to actually override error to null if .error was sent. Might be better to just always set .downloadError to null if .error is sent.

https://tbpl.mozilla.org/?tree=Try&rev=6b9b27fddeed
QA Whiteboard: [VH-FL-blocking-][VH-FC-blocking+]
Comment on attachment 8446335 [details] [diff] [review]
Only set downloadError to an error if it actually is an error and clear past errors after successful states

Review of attachment 8446335 [details] [diff] [review]:
-----------------------------------------------------------------

I just want to take another quick look before landing.

::: dom/apps/src/Webapps.js
@@ +589,5 @@
>          this[prop] = aMsg.app[prop];
>        }
>      }
>  
> +    if ('error' in aMsg) {

it's actually slower than the original.

@@ +648,5 @@
> +          // If we are in a successful state clear any past errors.
> +          if (
> +            aEventType === 'downloadapplied' ||
> +            aEventType === 'downloadsuccess'
> +          ) {

nit: the usual style is :
if (aEventType === 'downloadapplied' ||
    aEventType === 'downloadsuccess') {

@@ +649,5 @@
> +          if (
> +            aEventType === 'downloadapplied' ||
> +            aEventType === 'downloadsuccess'
> +          ) {
> +            dump('Webapps.js - clear error\n');

No unconditional dump() please.
Attachment #8446335 - Flags: review?(fabrice) → feedback+
re the use of 'in' I am not trying to check for "is it truthy" I am trying to check for "does the property exist" so when I set it to null it will be picked up.

dump is a typo new patch in a sec.
Comment on attachment 8446355 [details] [diff] [review]
Only set downloadError to an error if it actually is an error and clear past errors after successful states

Review of attachment 8446355 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/apps/src/Webapps.js
@@ +649,5 @@
> +          // If we are in a successful state clear any past errors.
> +          if (
> +            aEventType === 'downloadapplied' ||
> +            aEventType === 'downloadsuccess'
> +          ) {

you did not change the style there.
Attachment #8446355 - Flags: review?(fabrice)
Sorry not sure how I missed that comment...
Attachment #8446356 - Flags: review?(fabrice) → review+
Keywords: checkin-needed
Assignee: jlal → kgrandon
Target Milestone: --- → 2.0 S5 (4july)
I am greedy and want to be the assignee this this work is already done pending central landing... I will watch it until then.
Assignee: kgrandon → jlal
https://hg.mozilla.org/mozilla-central/rev/1836f9b10537
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: