Closed Bug 2083719 Opened 1 month ago Closed 6 days ago

Onboarding cards with an unrecognised disqualifier condition are shown instead of being treated as invalid

Categories

(Firefox for Android :: Onboarding, task)

All
Android
task
Points:
3

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: towhite, Assigned: towhite)

References

Details

(Whiteboard: [android-activation-trust] [fxdroid])

Attachments

(1 external file)

In OnboardingMapper.kt, shouldDisplayCard has a comment saying that if a card references a condition that is not in the feature's conditions lookup table, the JEXL cannot be evaluated and the card should be considered invalid.

The implementation only honours that for prerequisites. When a prerequisite is missing from the lookup, validPrerequisites is false and the card is hidden. When a disqualifier is missing from the lookup, the size check fails and hasDisqualifiers is set to false, so the card is shown. Unknown prerequisites fail closed, unknown disqualifiers fail open.

For a remotely configured juno-onboarding card, this means a typo or a condition name that only exists in a newer build makes the disqualifier silently disappear and the card displays unconditionally.

This went unnoticed because three tests in the androidTest OnboardingMapperTest never reached shouldDisplayCard. Each used an add search widget or notification permission card with the matching showAddWidgetPage or showNotificationPage flag set to false, so the device-capability filter in isCardEnabled removed the card first and the asserted empty result came from that filter:

  • noJexlConditionsAndNoCardConditions_shouldDisplayCard_returnsNoPage
  • noCardConditions_shouldDisplayCard_returnsNoPage
  • disqualifiersDontMatchJexlConditions_shouldDisplayCard_returnsNoPage

Bug 2082917 removes those cards and switches the three tests to a sync card, which has no capability gate. The first two now correctly assert that a card with no prerequisites and no disqualifiers is shown, and were renamed to returnsConvertedPage. The third also had to be renamed to disqualifiersDontMatchJexlConditions_shouldDisplayCard_returnsConvertedPage and now asserts the current fail-open behaviour, because changing the mapper is out of scope for a removal stack. That third test is the one this bug is about.

Decide whether unknown disqualifiers should fail closed to match the comment and the prerequisite handling, or whether fail-open is intended and the comment should be corrected. Either way, update shouldDisplayCard or its comment and disqualifiersDontMatchJexlConditions_shouldDisplayCard_returnsConvertedPage so they agree.

Points: --- → 3
Pushed by icedicedcoffee@proton.me: https://github.com/mozilla-firefox/firefox/commit/a48ec7d01f11 https://hg.mozilla.org/integration/autoland/rev/10851a93ef45 Fix onboarding cards being shown when an unrecognised disqualifier condition should make them invalid. r=corentin
Status: ASSIGNED → RESOLVED
Closed: 6 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: