[Single Variant] Single variant is executed 2 times

VERIFIED WONTFIX

Status

Firefox OS
Gaia::Homescreen
VERIFIED WONTFIX
4 years ago
4 years ago

People

(Reporter: rafael.marquez, Assigned: Carmen Jimenez Cabezas)

Tracking

unspecified
1.2 C6(Dec6)
Other
Gonk (Firefox OS)

Firefox Tracking Flags

(b2g-v1.2 affected)

Details

(Whiteboard: [systemsfe])

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
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 v1.2 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 the FTE with a sim card with mcc/mnc not configured in variant.json file
7. Turn off the device
8. Insert a sim configured in variant.json
9. Turn on the device

Expected Result
Single variant is not executed for the SIM inserted in step 8 because it was executed for the first sim card


*Actual Result
Single variant is executed for the SIM inserted in step 8. Single variant is executed 2 times


Device Unagi
Branch 1.2
Gecko 5fec309
Gaia 6e66cb7


variant.json file:
{
  "apps": {
    "Twitter":
      {
        "origin": "https://mobile.twitter.com",
        "manifestURL": "https://mobile.twitter.com/cache/twitter.webapp",
        "installOrigin": "https://marketplace.firefox.com"
      },
    "Facebook":
      {
        "origin": "http://m.facebook.com",
        "manifestURL": "http://m.facebook.com/openwebapp/manifest.webapp",
        "installOrigin": "https://marketplace.firefox.com"
      },
    "Wikipedia":
      {
        "origin": "https://bits.wikimedia.org",
        "manifestURL": "https://bits.wikimedia.org/WikipediaMobileFirefoxOS/manifest.webapp",
        "installOrigin": "https://marketplace.firefox.com"
      },
    "Accuweather":
      {
        "origin": "http://m.accuweather.com",
        "manifestURL": "http://m.accuweather.com/mozilla.webapp",
        "installOrigin": "https://marketplace.firefox.com"
      },
    "Calculator":
      {
        "origin": "app://calculator",
        "installOrigin": "https://marketplace.firefox.com",
        "manifestURL": "https://marketplace.firefox.com/app/9f96ce77-5b2d-42ca-a0d9-10a933dd84c4/manifest.webapp"
      },
    "Poppit":
      {
        "origin": "app://poppit",
        "installOrigin": "https://marketplace.firefox.com",
        "manifestURL": "https://marketplace.firefox.com/app/d37cb5ed-525a-408e-a7cf-ec848064e041/manifest.webapp"
      }
  },
  "operators": [
    {
      "id": "movistar",
      "mcc-mnc": [
        "214-001",
        "214-002",
        "214-005",
        "214-007"
      ],
      "apps": [
        {
          "id": "Calculator",
          "screen": 1,
          "location": 2
        },
        {
          "id": "Poppit",
          "screen": 1,
          "location": 3
        },
        {
          "id": "Wikipedia",
          "screen": 1,
          "location": 2
        },
	{
          "id": "Wikipedia",
          "screen": 2,
          "location": 2
        }
      ],
      "support_contacts": "resources/support_contacts_movistar.json",
      "default_contacts": "resources/contacts_movistar.json",
      "ringtone": "resources/Movistar_Mid_ABR_128kbps.ogg"
    }
(Reporter)

Updated

4 years ago
blocking-b2g: --- → koi?
status-b2g-v1.2: --- → affected
Whiteboard: [systemsfe]
Can you be a bit more specific about the impact here? Like give some examples around apps, wallpapers, contacts, etc.

I'm going to investigate this a bit more as well.
Flags: needinfo?(jsmith)
Actually, I'm going to assume this is applying to apps, as we don't do the functionality you've described for other types of variants. If it applies to more than apps, then indicate that.
Flags: needinfo?(jsmith)
(Reporter)

Comment 3

4 years ago
The bug applies to apps. Should not install apps after inserting the 2nd SIM.
(Assignee)

Updated

4 years ago
Assignee: nobody → cjc
(Assignee)

Comment 4

4 years ago
Created attachment 8338570 [details] [diff] [review]
Proposed patch v1

It only need to add undefined verification
Attachment #8338570 - Flags: review?(fabrice)
Comment on attachment 8338570 [details] [diff] [review]
Proposed patch v1

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

I haven't tested the patch with the configuration from comment #0 but it seems to me that with this patch we'll skip variant installation from step 6 (since we have no matching mcc/mnc) but then will run it in step 8. While it actually means we run in only one time, this may not be the one we want.
Attachment #8338570 - Flags: review?(fabrice)
(Assignee)

Comment 6

4 years ago
(Before applying the patch)
When there aren't apps configured for mcc-mnc, the following "for" sentence:

for (let i = 0; i < idsApp.length; i++) {

throws an exception because idsApp is undefined. For this reason, the following lines won't be executed:
 
this.eraseVariantAppsNotInList(idsApp);
Services.prefs.setBoolPref(PREF_FIRST_RUN_WITH_SIM, false);

Because PREF_FIRST_RUN_WITH_SIM has not been set in the next boot we're going to run again the code for SingleVariant and this is the reason why in step 9 the single variant code is executed.

(After patch)
The "if" sentence prevents throwing on undefined idsApp, and thus allows setting the preference and the unused apps directories are removed (all of them in this case)
Because the preference has been set in the next boot the singleVariant code won't be executed
Flags: needinfo?(fabrice)
(Assignee)

Comment 7

4 years ago
On second thought, and confirmed after talking with our product guys, the current behaviour is the desired one. For phones that include single variant apps, the desired behaviour is for apps to be installed the first time a single variant SIM is inserted, no matter if that's the first actual SIM inserted or not.
Flags: needinfo?(fabrice)
Status: NEW → RESOLVED
blocking-b2g: koi? → ---
Last Resolved: 4 years ago
Resolution: --- → WONTFIX
(Reporter)

Updated

4 years ago
Status: RESOLVED → VERIFIED

Updated

4 years ago
No longer blocks: 893800
You need to log in before you can comment on or make changes to this bug.