Onboarding cards with an unrecognised disqualifier condition are shown instead of being treated as invalid
Categories
(Firefox for Android :: Onboarding, task)
Tracking
()
| 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_returnsNoPagenoCardConditions_shouldDisplayCard_returnsNoPagedisqualifiersDontMatchJexlConditions_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.
Updated•1 month ago
|
Comment 1•7 days ago
|
||
(via GitHub webhook, authenticated as shared-secret)
Comment 3•6 days ago
|
||
| bugherder | ||
Description
•