Skip to content

[PM-39612] fix: resolve autofill container-hint redirect to autofillable child#7146

Open
aj-rosado wants to merge 3 commits into
mainfrom
PM-39612/fix-autofill-container-hint-redirect
Open

[PM-39612] fix: resolve autofill container-hint redirect to autofillable child#7146
aj-rosado wants to merge 3 commits into
mainfrom
PM-39612/fix-autofill-container-hint-redirect

Conversation

@aj-rosado

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-39612

📔 Objective

Some Android apps wrap their login EditText fields inside a container view (e.g., Material TextInputLayout). The container carries the semantic autofill hint (USERNAME, PASSWORD) but has autofillType = NONE (0), meaning it cannot receive a fill value. The inner EditText has autofillType = TEXT (1) but no hint, so heuristics never classify it. As a result, autofill silently failed — the fill dataset was built against the container's autofillId with autofillType = 0, which the framework dropped at fill time.

Changes:

  • ViewNodeExtensions.kt: When a container node carries a semantic hint but has autofillType = NONE, findFirstAutofillableChild() locates the first descendant with autofillType = TEXT. The child's autofillId and autofillType are used in AutofillView.Data so the fill reaches the actual input field.
  • AutofillParserImpl.kt: Added claimedAutofillIds tracking during traversal to prevent a child node from being added a second time after the container has already redirected to it.

@aj-rosado aj-rosado added the ai-review Request a Claude code review label Jul 7, 2026
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug labels Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the autofill container-hint redirect fix across ViewNodeExtensions.kt (redirecting a hinted AUTOFILL_TYPE_NONE container to its first autofillable descendant) and AutofillParserImpl.kt (tracking claimedAutofillIds during traversal to prevent double-adding a redirected child). Traced the recursive traversal: the claimedAutofillIds set is populated by the container before its children are visited, and the redirect target is always within the container's own subtree, so deduplication coverage is correct and the ignoreAutofillIds filter change is a consistency improvement. Test coverage exercises the direct-child redirect, nested-grandchild redirect, no-autofillable-child fallback, and the parser-level deduplication path.

No blocking findings.

Code Review Details

No findings at or above the confidence threshold. The change is a focused bug fix with matching unit tests; the redirect and deduplication logic were traced and behave correctly, including the nested-descendant and fallback cases.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.48%. Comparing base (fe2e7c0) to head (650e227).

Files with missing lines Patch % Lines
...bitwarden/data/autofill/util/ViewNodeExtensions.kt 90.90% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7146      +/-   ##
==========================================
- Coverage   86.76%   86.48%   -0.29%     
==========================================
  Files         868      912      +44     
  Lines       63975    65511    +1536     
  Branches     9585     9610      +25     
==========================================
+ Hits        55511    56654    +1143     
- Misses       5023     5412     +389     
- Partials     3441     3445       +4     
Flag Coverage Δ
app-data 17.29% <94.87%> (-0.31%) ⬇️
app-ui-auth-tools 18.65% <0.00%> (-0.16%) ⬇️
app-ui-platform 16.78% <0.00%> (+0.30%) ⬆️
app-ui-vault 28.05% <0.00%> (+0.55%) ⬆️
authenticator 6.13% <0.00%> (-0.05%) ⬇️
lib-core-network-bridge 4.06% <0.00%> (-0.02%) ⬇️
lib-data-ui 1.14% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aj-rosado aj-rosado marked this pull request as ready for review July 7, 2026 15:15
@aj-rosado aj-rosado requested review from a team and david-livefront as code owners July 7, 2026 15:15
@aj-rosado aj-rosado added t:misc Change Type - ¯\_(ツ)_/¯ and removed t:misc Change Type - ¯\_(ツ)_/¯ labels Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant