Closed Bug 936018 Opened 11 years ago Closed 11 years ago

[Single Variant] Sometimes package apps icons are not correctly installed if finish quickly the FTE

Categories

(Firefox OS Graveyard :: Gaia::Homescreen, defect)

Other
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:koi+, firefox26 wontfix, firefox27 wontfix, firefox28 fixed, b2g-v1.2 fixed)

VERIFIED FIXED
1.2 C5(Nov22)
blocking-b2g koi+
Tracking Status
firefox26 --- wontfix
firefox27 --- wontfix
firefox28 --- fixed
b2g-v1.2 --- fixed

People

(Reporter: rafael.marquez, Assigned: amac)

References

Details

(Whiteboard: [systemsfe])

Attachments

(3 files, 2 obsolete files)

****Steps 1. Installing a v1.2 build on device 2. Clone the tests repository for sigle variant: https://github.com/telefonicaid/firefoxos-gaia-testsbuild.git 3. Configuring the file variant.json 4. Clone Gaia repository and select the master branch. 5. Executing the command "GAIA_DISTRIBUTION_DIR=/home/tel056/firefoxos-gaia-testsbuild PRODUCTION=1 make reset-gaia" to install gaia with single variant in the device 6.Complete quickly the FTE with a movistar SIM (in this case the configured in the file .json) ***Expected Result Packaged apps are instaled correctly ***Actual Result Packaged app are instaled with default icon Device Unagi Branch 1.2 Gecko 1303dc0 Gaia 2140c98
blocking-b2g: --- → koi?
Does rebooting the phone fix the problem (as in making the correct icon appear)? If it does, I think this is bug 936018.
(In reply to Antonio Manuel Amaya Calvo (:amac) from comment #1) > Does rebooting the phone fix the problem (as in making the correct icon > appear)? If it does, I think this is bug 936018. Ok, I meant bug 903291.
Depends on: 903291
We probably need to fix this independently of bug 903291 - we have branding requirements that require the icon to be correct on preinstall.
(In reply to Jason Smith [:jsmith] from comment #3) > We probably need to fix this independently of bug 903291 - we have branding > requirements that require the icon to be correct on preinstall. The problem is that this *is* caused by bug 903291. And it doesn't actually depend on how fast you finish the FTE, rather it depends on how small the app is, and how unlucky you are. In fact, it can also happen with any app you install from any market, not just the single variant ones. When the bug hits you, the application objects on the homescreen are created with an incorrect state, and that's what causes them to now show the correct icon (since homescreen believes they're still installing). The only solution (with the current implementation) is to either reboot the phone or to somehow kill the homescreen app. So a possible workaround would be killing/restarting the homescreen from system after the FTU is done (or just delaying creating it till then).
There's an ugly workaround for this, which is to kill the homescreen app after the operator apps have been installed. System should restart it automagically, and it would get the correct state for the apps. It's very ugly... but should work. Another ugly solution would be to make the app installation run slower. That would also give time to the homescreen to setup its handlers before the app is installed. Other than that, I don't think this can be fixed completely without fixing bug 903291.
Changed to Koi+. This is a branding requirement and a Content Team requirement.
blocking-b2g: koi? → koi+
Assignee: nobody → amac
Target Milestone: --- → 1.3 Sprint 5 - 11/22
koi+ is for 1.2. We should use 1.2 target milestone rather than 1.3 target milestone.
Target Milestone: 1.3 Sprint 5 - 11/22 → 1.2 C5(Nov22)
(In reply to Antonio Manuel Amaya Calvo (:amac) from comment #5) > There's an ugly workaround for this, which is to kill the homescreen app > after the operator apps have been installed. System should restart it > automagically, and it would get the correct state for the apps. It's very > ugly... but should work. > > Another ugly solution would be to make the app installation run slower. That > would also give time to the homescreen to setup its handlers before the app > is installed. > > Other than that, I don't think this can be fixed completely without fixing > bug 903291. Bug 903291 isn't targeted for 1.2 given complexity. Let's go with the first proposed workaround, if only visible when you run through FTE too quickly (the issue this bug represents). If that's not possible, or the issue isn't FTE-specific, let's go with your second proposed workaround (a minimum app install time). Can you move forward here amac?
I'm with this. But at this time I'm hitting into another problem, which I don't know if it's the original problem Rafa ran into. The apps aren't installed and I'm getting a SEC_ERROR_EXPIRED_CERTIFICATE when verifying the signature.
Ok, the SEC_ERROR_EXPIRED_CERTIFICATE happens because if the phone have been really reset it doesn't have the correct date, and so the apps aren't installed. I think that this might be the problem Rafa ran into. I'm going to upload a patch to not check the signature of single variant/local apps to fix that (because that's actually going to be a problem with real, mint-new devices). Regarding the race condition, I haven't been able to reproduce it. In fact (and I stand corrected) the patch I made in https://bugzilla.mozilla.org/attachment.cgi?id=804889 should have taken care of most of the race condition issues (at least for successful installations, failures might run into race conditions still).
I uploaded a patch for the certificate problem at bug 926219, and I think I managed to reproduce this at least once... now I only have to find *why* it's still failing :)
Attached patch V1. Gecko patch (B2G 26 version) (obsolete) — Splinter Review
This just ensures that we actually update the object even when the process was already known to us. The previous version worked great on the tests, but not so great with real usage :(.
Attachment #8334913 - Flags: review?(fabrice)
There are actually two problems here. One with Gecko, which I think the patch I just uploaded fixes. Sometimes we weren't updating the state of the object on the child processes. And the other problem is in Gaia, concretely in [1]. We're passing this as icon there, and we should really create a new object and reference the fields of this we actually need (uid and descriptor.icon only). Otherwise, we run into a nice problem: Assuming to updates arrive back to back, the first one starts processing but the second one doesn't since the validation it does at [2] is true always (basically because pendingRequest.icon and request.icon are exactly the same object). And that means the second request isn't processed and so the icon isn't updated. I will upload a patch for Gaia tomorrow. [1] https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/js/page.js#L203 [2] https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/js/icon_retriever.js#L110
Status: NEW → ASSIGNED
Comment on attachment 8334913 [details] [diff] [review] V1. Gecko patch (B2G 26 version) This is the B2G26 version. Uploading the M-C version in a few (turns out this part have changed and it doesn't apply)
Attachment #8334913 - Attachment description: V1. Gecko patch → V1. Gecko patch (B2G 26 version)
Attached patch V1. Mozilla Central version (obsolete) — Splinter Review
This is the same patch, but for the M-C repo. I don't really know if it's worth landing this on M-C now since I guess all this code is going away once Fernando finish rewriting all the Webapps related IPC, still this one is quite simple.
Attachment #8335212 - Flags: review?(fabrice)
Comment on attachment 8335212 [details] [diff] [review] V1. Mozilla Central version Review of attachment 8335212 [details] [diff] [review]: ----------------------------------------------------------------- r=me with comment fixed. ::: dom/apps/src/Webapps.jsm @@ +963,5 @@ > refCount: 1 > }); > + } > + > + // If it wasn't registered before, let's update its state Update the comment.
Attachment #8335212 - Flags: review?(fabrice) → review+
Comment on attachment 8334913 [details] [diff] [review] V1. Gecko patch (B2G 26 version) Review of attachment 8334913 [details] [diff] [review]: ----------------------------------------------------------------- r=me ::: dom/apps/src/Webapps.jsm @@ +917,5 @@ > refCount: 1 > }); > + } > + > + // If it wasn't registered before, let's update its state Update comment.
Attachment #8334913 - Flags: review?(fabrice) → review+
Comment on attachment 8335422 [details] [review] Gaia patch to allow loading icons reentrantly Please request again a review when the unit tests are fixed and all comments are addressed what you consider needed or useful. Thanks
Attachment #8335422 - Flags: review?(crdlc)
Comment on attachment 8335422 [details] [review] Gaia patch to allow loading icons reentrantly Good job, thanks a lot
Attachment #8335422 - Flags: review+
Attachment #8334913 - Attachment is obsolete: true
Gaia and Gecko patches are independent (so it doesn't matter the order they're checked in).
The try run looks ok, requesting checkin for the gecko part. The Gaia patch already landed.
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Keywords: verifyme
Added flags to uplift patches to version 1.2
Sorry, forgot that there's a Gaia patch for this too. Setting status-b2g-v1.2 back to affected until that's uplifted.
Flags: needinfo?(jhford)
Uplifted cdab4981044ddcf0ca32cab6e66a8141556701dc to: v1.2: 3c89aab6777f0ece3b30545b9b9bc7139c70d9b2
Flags: needinfo?(jhford)
Verified: Device unagi Branch 1.2 Gecko 6ac8a1e Gaia 264c604
Status: RESOLVED → VERIFIED
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: