[PR #4855] [MERGED] PM-18844: Update BitwardenBasicDialog to allow it to share error logs #5259

Closed
opened 2025-11-26 23:56:33 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/4855
Author: @david-livefront
Created: 3/12/2025
Status: Merged
Merged: 3/13/2025
Merged by: @david-livefront

Base: mainHead: PM-18844-share-error-button


📝 Commits (1)

  • d99f4e1 PM-18844: Update BitwardenBasicDialog to allow it to share error logs

📊 Changes

51 files changed (+423 additions, -177 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/MainActivity.kt (+1 -1)
📝 app/src/main/java/com/x8bit/bitwarden/MainViewModel.kt (+52 -6)
📝 app/src/main/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryImpl.kt (+1 -1)
📝 app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/BreachCountResult.kt (+4 -1)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/FlagKey.kt (+11 -1)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/components/dialog/BitwardenBasicDialog.kt (+37 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/composition/LocalManagerProvider.kt (+44 -18)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/debugmenu/components/FeatureFlagListItems.kt (+16 -10)
app/src/main/java/com/x8bit/bitwarden/ui/platform/model/FeatureFlagsState.kt (+14 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditScreen.kt (+1 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt (+42 -30)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemScreen.kt (+1 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt (+17 -8)
📝 app/src/main/res/values/strings.xml (+1 -0)
📝 app/src/main/res/values/strings_non_localized.xml (+1 -0)
📝 app/src/test/java/com/x8bit/bitwarden/MainViewModelTest.kt (+12 -0)
📝 app/src/test/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt (+3 -2)
📝 app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupAutofillScreenTest.kt (+3 -2)
📝 app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupUnlockScreenTest.kt (+3 -2)
📝 app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/checkemail/CheckEmailScreenTest.kt (+3 -2)

...and 31 more files

📄 Description

🎟️ Tracking

PM-18844

📔 Objective

This PR adds support for sharing error logs via the share sheet from the BitwardenBasicDialog.

Main changes:

  • The MobileErrorReporting feature flag has been added to the app with the remote-config and the default value disabled.
  • A new flow was added to support scoped feature flags inside the UI.
  • Base compose tests have been updated to support having Bitwarden local composition managers injected and overridable without needing to pass the values down from the screen.
  • The Check password for breaches feature now supports error reporting.

Sample of the copyable data:

Stacktrace:
java.lang.IndexOutOfBoundsException: Index 5 out of bounds for length 2
	jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
	java.util.Objects.checkIndex(Objects.java:359)
	java.util.ArrayList.get(ArrayList.java:434)
	com.x8bit.bitwarden.data.auth.datasource.network.service.HaveIBeenPwnedServiceImpl.getPasswordBreachCount-gIAlu-s(HaveIBeenPwnedServiceImpl.kt:32)
	com.x8bit.bitwarden.data.auth.datasource.network.service.HaveIBeenPwnedServiceImpl$getPasswordBreachCount$1.invokeSuspend(Unknown Source:15)
	kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	android.os.Handler.handleCallback(Handler.java:991)
	android.os.Handler.dispatchMessage(Handler.java:102)
	android.os.Looper.loopOnce(Looper.java:232)
	android.os.Looper.loop(Looper.java:317)
	android.app.ActivityThread.main(ActivityThread.java:8787)
	java.lang.reflect.Method.invoke(Native Method)
	com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
	com.android.internal.os.ZygoteInit.main(ZygoteInit.java:871)
Version: 2024.9.0 (1)
Device: :iphone: google Pixel 8 :robot_face: 15@35 :package: dev
CI: local

📸 Screenshots

Before After

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) 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/4855 **Author:** [@david-livefront](https://github.com/david-livefront) **Created:** 3/12/2025 **Status:** ✅ Merged **Merged:** 3/13/2025 **Merged by:** [@david-livefront](https://github.com/david-livefront) **Base:** `main` ← **Head:** `PM-18844-share-error-button` --- ### 📝 Commits (1) - [`d99f4e1`](https://github.com/bitwarden/android/commit/d99f4e1ac23ea54be59844f79cdb592a10f3e912) PM-18844: Update BitwardenBasicDialog to allow it to share error logs ### 📊 Changes **51 files changed** (+423 additions, -177 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/MainActivity.kt` (+1 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/MainViewModel.kt` (+52 -6) 📝 `app/src/main/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryImpl.kt` (+1 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/BreachCountResult.kt` (+4 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/FlagKey.kt` (+11 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/components/dialog/BitwardenBasicDialog.kt` (+37 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/composition/LocalManagerProvider.kt` (+44 -18) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/debugmenu/components/FeatureFlagListItems.kt` (+16 -10) ➕ `app/src/main/java/com/x8bit/bitwarden/ui/platform/model/FeatureFlagsState.kt` (+14 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditScreen.kt` (+1 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt` (+42 -30) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemScreen.kt` (+1 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt` (+17 -8) 📝 `app/src/main/res/values/strings.xml` (+1 -0) 📝 `app/src/main/res/values/strings_non_localized.xml` (+1 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/MainViewModelTest.kt` (+12 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt` (+3 -2) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupAutofillScreenTest.kt` (+3 -2) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupUnlockScreenTest.kt` (+3 -2) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/checkemail/CheckEmailScreenTest.kt` (+3 -2) _...and 31 more files_ </details> ### 📄 Description ## 🎟️ Tracking [PM-18844](https://bitwarden.atlassian.net/browse/PM-18844) ## 📔 Objective This PR adds support for sharing error logs via the share sheet from the `BitwardenBasicDialog`. Main changes: * The `MobileErrorReporting` feature flag has been added to the app with the remote-config and the default value disabled. * A new flow was added to support scoped feature flags inside the UI. * Base compose tests have been updated to support having Bitwarden local composition managers injected and overridable without needing to pass the values down from the screen. * The `Check password for breaches` feature now supports error reporting. Sample of the copyable data: ``` Stacktrace: java.lang.IndexOutOfBoundsException: Index 5 out of bounds for length 2 jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) java.util.Objects.checkIndex(Objects.java:359) java.util.ArrayList.get(ArrayList.java:434) com.x8bit.bitwarden.data.auth.datasource.network.service.HaveIBeenPwnedServiceImpl.getPasswordBreachCount-gIAlu-s(HaveIBeenPwnedServiceImpl.kt:32) com.x8bit.bitwarden.data.auth.datasource.network.service.HaveIBeenPwnedServiceImpl$getPasswordBreachCount$1.invokeSuspend(Unknown Source:15) kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100) android.os.Handler.handleCallback(Handler.java:991) android.os.Handler.dispatchMessage(Handler.java:102) android.os.Looper.loopOnce(Looper.java:232) android.os.Looper.loop(Looper.java:317) android.app.ActivityThread.main(ActivityThread.java:8787) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:871) Version: 2024.9.0 (1) Device: :iphone: google Pixel 8 :robot_face: 15@35 :package: dev CI: local ``` ## 📸 Screenshots | Before | After | | --- | --- | | <img src="https://github.com/user-attachments/assets/520887ab-6290-47a9-b808-d4d0bd02b94d" width="300" /> | <img src="https://github.com/user-attachments/assets/3a2d46a4-b93b-4f4d-a774-7470022a34d5" width="300" /> | ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) 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 [PM-18844]: https://bitwarden.atlassian.net/browse/PM-18844?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --- <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 2025-11-26 23:56:33 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#5259