[PR #3418] [MERGED] BIT-2446: Limit the number of inline autofill items that can be displayed #111251

Closed
opened 2026-06-06 07:47:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/3418
Author: @david-livefront
Created: 7/8/2024
Status: Merged
Merged: 7/9/2024
Merged by: @david-livefront

Base: mainHead: limit-inline-autofill-responses


📝 Commits (1)

  • 748fe48 BIT-2446: Limit the number of inline autofill items that can be displayed

📊 Changes

2 files changed (+110 additions, -2 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/data/autofill/builder/FilledDataBuilderImpl.kt (+20 -2)
📝 app/src/test/java/com/x8bit/bitwarden/data/autofill/builder/FilledDataBuilderTest.kt (+90 -0)

📄 Description

🎟️ Tracking

BIT-2446

📔 Objective

This PR limits the number of inline autofill suggestions a user can see as well as the number of regular autofill suggestions a user can see. If the user has additional items, they can still view them by selecting the My Vault item.

The documentation for inline autofill suggests no more than 5 for performace reasons:

    /**
     * Max number of suggestions expected from the response. It must be a positive value.
     * Defaults to {@code SUGGESTION_COUNT_UNLIMITED} if not set.
     *
     * <p>In practice, it is recommended that the max suggestion count does not exceed <b>5</b>
     * for performance reasons.</p>
     */

We additionally want to avoid TransactionTooLargeExceptions that can occur when the fill response is too large. documentation can be found here.

To prevent the Android system from throwing an exception in these scenarios, you can keep the FillResponse small by adding no more than 20 Dataset objects at a time.

An error from this has already appeared in the beta:

   Fatal Exception: java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 3444472 bytes
       at android.service.autofill.FillCallback.onSuccess(FillCallback.java:72)
       at com.x8bit.bitwarden.data.autofill.processor.AutofillProcessorImpl$process$1.invokeSuspend(AutofillProcessorImpl.kt:135)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:363)
       at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26)
       at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:21)
       at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:88)
       at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:123)

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/3418 **Author:** [@david-livefront](https://github.com/david-livefront) **Created:** 7/8/2024 **Status:** ✅ Merged **Merged:** 7/9/2024 **Merged by:** [@david-livefront](https://github.com/david-livefront) **Base:** `main` ← **Head:** `limit-inline-autofill-responses` --- ### 📝 Commits (1) - [`748fe48`](https://github.com/bitwarden/android/commit/748fe4870862a4388b3365d38aef3d04bbe8e789) BIT-2446: Limit the number of inline autofill items that can be displayed ### 📊 Changes **2 files changed** (+110 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/data/autofill/builder/FilledDataBuilderImpl.kt` (+20 -2) 📝 `app/src/test/java/com/x8bit/bitwarden/data/autofill/builder/FilledDataBuilderTest.kt` (+90 -0) </details> ### 📄 Description ## 🎟️ Tracking [BIT-2446](https://livefront.atlassian.net/browse/BIT-2446) ## 📔 Objective This PR limits the number of inline autofill suggestions a user can see as well as the number of regular autofill suggestions a user can see. If the user has additional items, they can still view them by selecting the `My Vault` item. The documentation for inline autofill suggests no more than 5 for performace reasons: ``` /** * Max number of suggestions expected from the response. It must be a positive value. * Defaults to {@code SUGGESTION_COUNT_UNLIMITED} if not set. * * <p>In practice, it is recommended that the max suggestion count does not exceed <b>5</b> * for performance reasons.</p> */ ``` We additionally want to avoid `TransactionTooLargeException`s that can occur when the fill response is too large. documentation can be found [here](https://developer.android.com/identity/autofill/autofill-services#advanced). ``` To prevent the Android system from throwing an exception in these scenarios, you can keep the FillResponse small by adding no more than 20 Dataset objects at a time. ``` An error from this has already appeared in the beta: ``` Fatal Exception: java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 3444472 bytes at android.service.autofill.FillCallback.onSuccess(FillCallback.java:72) at com.x8bit.bitwarden.data.autofill.processor.AutofillProcessorImpl$process$1.invokeSuspend(AutofillProcessorImpl.kt:135) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:363) at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26) at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:21) at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:88) at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:123) ``` ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-06-06 07:47:59 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#111251