Closed Bug 1156161 Opened 9 years ago Closed 9 years ago

Add manifestHash and packageHash fields to preload apps' registry in webapps.json.

Categories

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

All
Gonk (Firefox OS)
defect
Not set
major

Tracking

(blocking-b2g:2.2+, b2g-v2.2 fixed, b2g-master fixed)

RESOLVED FIXED
2.2 S11 (1may)
blocking-b2g 2.2+
Tracking Status
b2g-v2.2 --- fixed
b2g-master --- fixed

People

(Reporter: jj.evelyn, Assigned: rickychien)

References

Details

Attachments

(3 files)

In bug 1125034 and bug 1150442, we met app update issues because of lack of these two fields. In latest Gecko, the two fields will be checked while doing app update to know if we need to apply an update from Marketplace. Missing these two fields in webapps.json of FOTA image causes registry mismatch(with package zip) because they remain in old values. We workaround this issue in 2.0 by force reset two fields while doing FOTA, however, we should write these two hashes correctly by calculating from real manifest file and zip.

See bug 1150442 comment 17 and comment 19 to know details.
Ricky, could you help out in this bug? I hope this issue could be fixed on master and uplift to 2.2 (and even 2.1) to avoid it happening again. Thank you.
blocking-b2g: --- → 2.2?
Flags: needinfo?(ricky060709)
Assignee: nobody → ricky060709
blocking-b2g: 2.2? → 2.2+
Comment on attachment 8596510 [details] [review]
[gaia] RickyChien:add-manifestHash-and-packageHash > mozilla-b2g:master

Patch has submitted! Both manifestHash and packageHash fields are added in webapps.json. 
A Makefile's target update-webapps-json will be invoked after all app building step in order to fetch information which generated in previous step. As a result, we could calculate these hashes properly.
If manifest.webapp is not found, it will try to calculate hash from package.json file.

George, could you take a time to review this patch?
Fabrice, could you help me verify these hashes work properly? 

thanks!
Flags: needinfo?(ricky060709)
Attachment #8596510 - Flags: review?(gduan)
Attachment #8596510 - Flags: feedback?(fabrice)
Attachment #8596510 - Flags: feedback?(fabrice) → feedback+
Comment on attachment 8596510 [details] [review]
[gaia] RickyChien:add-manifestHash-and-packageHash > mozilla-b2g:master



Hi Evelyn, I'm curious what you stated in comment 0(In reply to Evelyn Hung [:evelyn] from comment #0)
> In bug 1125034 and bug 1150442, we met app update issues because of lack of
> these two fields. In latest Gecko, the two fields will be checked while
> doing app update to know if we need to apply an update from Marketplace.
> Missing these two fields in webapps.json of FOTA image causes registry
> mismatch(with package zip) because they remain in old values. We workaround
> this issue in 2.0 by force reset two fields while doing FOTA, however, we
> should write these two hashes correctly by calculating from real manifest
> file and zip.

Hi Evelyn,
this patch looks good to me, but I'm not sure if it meets our requirement.
In Ricky's patch, the hash is calculated by manifest or update.webapp or package.json, they would probably remain the same if the contents don't change. Is it possible to break the case? Especially when gaia version is upgraded, but all of those files remains.
Attachment #8596510 - Flags: feedback?(ehung)
Comment on attachment 8596510 [details] [review]
[gaia] RickyChien:add-manifestHash-and-packageHash > mozilla-b2g:master

r=gduan,

Offline discussed with Evelyn. the hash5 of the updated app from marketplace would be different due to etag and version are changed. So, I think this patch is ok to me.
Attachment #8596510 - Flags: review?(gduan)
Attachment #8596510 - Flags: review+
Attachment #8596510 - Flags: feedback?(ehung)
Land in master: https://github.com/mozilla-b2g/gaia/commit/196c8bb1e36d1986ecfd72b92c4b8f76268b3050
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Ricky, following https://bugzilla.mozilla.org/show_bug.cgi?id=1150442#c36 suggestion, could you please ask for approval to land in 2.2 branch?
Flags: needinfo?(ricky060709)
sorry had to revert this for bustage like https://treeherder.mozilla.org/logviewer.html#?job_id=1803003&repo=b2g-inbound
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Patch has been updated for fixing treeherder busted.

Push to try:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=fc5eefd70fe2
Flags: needinfo?(ricky060709)
Sorry for my mistake while pushing a wrong gaia.json.
Push to try again:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=2ee2ef61b9e3
Comment on attachment 8597940 [details] [review]
[gaia] RickyChien:add-manifestHash-and-packageHash > mozilla-b2g:master

[Approval Request Comment]
[Bug caused by] (feature/regressing bug #): no
[User impact] if declined: The third party application cannot update normally after FOTA updating
[Testing completed]: It has been verified by fabrice.
[Risk to taking this patch] (and alternatives if risky): no
[String changes made]:
Attachment #8597940 - Flags: approval-gaia-v2.2?
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
Attachment #8597940 - Flags: approval-gaia-v2.2? → approval-gaia-v2.2+
Land in v2.2 again for fixing jshint errors:

https://github.com/mozilla-b2g/gaia/commit/aa1da5036f9425c25d515d14243d3473bfefb4fd
Flags: needinfo?(ricky060709)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: