null entries in init.json break the world

RESOLVED FIXED

Status

Firefox OS
Gaia::Homescreen
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: fabrice, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
When building with GAIA_DISTRIBUTION_DIR, we end up with this init.json :

{
  "grid": [
    [
      {
        "entry_point": "dialer",
        "name": "Phone",
        "manifestURL": "app:\/\/communications.gaiamobile.org\/manifest.webapp",
        "icon": "app:\/\/communications.gaiamobile.org\/dialer\/style\/icons\/dialer_84.png"
      },
      {
        "name": "Messages",
        "manifestURL": "app:\/\/sms.gaiamobile.org\/manifest.webapp",
        "icon": "app:\/\/sms.gaiamobile.org\/icons\/sms_84.png"
      },
      {
        "entry_point": "contacts",
        "name": "Contacts",
        "manifestURL": "app:\/\/communications.gaiamobile.org\/manifest.webapp",
        "icon": "app:\/\/communications.gaiamobile.org\/contacts\/style\/icons\/contacts_84.png"
      },
      {
        "name": "E-Mail",
        "manifestURL": "app:\/\/email.gaiamobile.org\/manifest.webapp",
        "icon": "app:\/\/email.gaiamobile.org\/style\/icons\/email_84.png"
      },
      {
        "name": "Browser",
        "manifestURL": "app:\/\/search.gaiamobile.org\/manifest.webapp",
        "icon": "app:\/\/search.gaiamobile.org\/shared\/resources\/branding\/browser_84.png"
      }
    ],
    [
      null,
      {
        "name": "Gallery",
        "manifestURL": "app:\/\/gallery.gaiamobile.org\/manifest.webapp",
        "icon": "app:\/\/gallery.gaiamobile.org\/style\/icons\/gallery_84.png"
      },
      {
        "name": "Music",
        "manifestURL": "app:\/\/music.gaiamobile.org\/manifest.webapp",
        "icon": "app:\/\/music.gaiamobile.org\/style\/icons\/music_84.png"
      },
      {
        "name": "Video",
        "manifestURL": "app:\/\/video.gaiamobile.org\/manifest.webapp",
        "icon": "app:\/\/video.gaiamobile.org\/style\/icons\/video_84.png"
      },
      {
        "name": "Marketplace",
        "manifestURL": "https:\/\/marketplace.firefox.com\/packaged.webapp",
        "icon": "app:\/\/marketplace.firefox.com\/app-icons\/60.png"
      }
    ],
    [
      {
        "name": "Calendar",
        "manifestURL": "app:\/\/calendar.gaiamobile.org\/manifest.webapp",
        "icon": "app:\/\/calendar.gaiamobile.org\/style\/icons\/calendar_84.png"
      },
      {
        "name": "Clock",
        "manifestURL": "app:\/\/clock.gaiamobile.org\/manifest.webapp",
        "icon": "app:\/\/clock.gaiamobile.org\/style\/icons\/clock_84.png"
      },
      {
        "name": "Settings",
        "manifestURL": "app:\/\/settings.gaiamobile.org\/manifest.webapp",
        "icon": "app:\/\/settings.gaiamobile.org\/style\/icons\/settings_84.png"
      },
      null
    ],
    [
      null,
      null,
      null,
      {
        "name": "Usage",
        "manifestURL": "app:\/\/costcontrol.gaiamobile.org\/manifest.webapp",
        "icon": "app:\/\/costcontrol.gaiamobile.org\/style\/icons\/costcontrol_84.png"
      }
    ]
  ],
  "preferences": {
    "grid.cols": 3
  }
}

So, one bug is that we should very likely *not* have these `null` entries, but we should anyway not fail badly when we hit one. However https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/js/firstrun.js#L27 doesn't deal with null entries.
Created attachment 8663868 [details] [review]
[gaia] fabricedesre:homescreen-b2gdroid > mozilla-b2g:master
(Reporter)

Updated

3 years ago
Attachment #8663868 - Flags: review?(chrislord.net)

Comment 2

3 years ago
Comment on attachment 8663868 [details] [review]
[gaia] fabricedesre:homescreen-b2gdroid > mozilla-b2g:master

r+ with an added unit test in test/unit/firstrun_test.js
Attachment #8663868 - Flags: review?(chrislord.net) → review+
(Reporter)

Comment 3

3 years ago
https://github.com/mozilla-b2g/gaia/commit/28b300d89358560fb6c43f41033fd157ecfbd3f7
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.