[PR #5013] [MERGED] [PM-19613] Save attachment error message update #5402

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/5013
Author: @andrebispo5
Created: 4/9/2025
Status: Merged
Merged: 4/14/2025
Merged by: @andrebispo5

Base: mainHead: pm-19613/attachment_save_error


📝 Commits (10+)

  • dbf3b2a [PM-19613] Return server error message to ViewModel error dialog
  • 93d7e66 [PM-19613] Fix tests
  • 8641c32 Merge branch 'main' into pm-19613/attachment_save_error
  • 34b2b94 [PM-19613] Refactor AttachmentJsonResponse to remove nested class from Success
  • e7079c1 Merge branch 'pm-19613/attachment_save_error' of https://github.com/bitwarden/android into pm-19613/attachment_save_error
  • 9b1f616 [PM-19613] Move error message to its property
  • cab1908 [PM-19613] Add tests
  • 9b31ae6 [PM-19613] Fix test
  • 004cf36 [PM-19613] Lint
  • dac1274 Merge branch 'main' into pm-19613/attachment_save_error

📊 Changes

13 files changed (+264 additions, -48 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/model/InvalidJsonResponse.kt (+3 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/service/CiphersService.kt (+1 -1)
📝 app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/service/CiphersServiceImpl.kt (+15 -7)
📝 app/src/main/java/com/x8bit/bitwarden/data/vault/manager/CipherManagerImpl.kt (+29 -5)
📝 app/src/main/java/com/x8bit/bitwarden/data/vault/repository/model/CreateAttachmentResult.kt (+4 -1)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsViewModel.kt (+2 -1)
📝 app/src/test/java/com/x8bit/bitwarden/data/vault/datasource/network/service/CiphersServiceTest.kt (+36 -10)
📝 app/src/test/java/com/x8bit/bitwarden/data/vault/manager/CipherManagerTest.kt (+14 -7)
📝 app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsViewModelTest.kt (+78 -3)
📝 network/src/main/kotlin/com/bitwarden/network/api/CiphersApi.kt (+1 -1)
📝 network/src/main/kotlin/com/bitwarden/network/model/AttachmentJsonResponse.kt (+38 -11)
network/src/main/kotlin/com/bitwarden/network/model/InvalidJsonResponse.kt (+28 -0)
📝 network/src/testFixtures/kotlin/com/bitwarden/network/model/AttachmentJsonResponseUtil.kt (+15 -1)

📄 Description

🎟️ Tracking

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

📔 Objective

When a user with a free organization tries to save an attachment a generic error is shown. Instead we should pass down the error returned from the server.

📸 Screenshots

https://github.com/user-attachments/assets/ee44bee8-8fa4-4453-af04-04ed9e723b1b

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/5013 **Author:** [@andrebispo5](https://github.com/andrebispo5) **Created:** 4/9/2025 **Status:** ✅ Merged **Merged:** 4/14/2025 **Merged by:** [@andrebispo5](https://github.com/andrebispo5) **Base:** `main` ← **Head:** `pm-19613/attachment_save_error` --- ### 📝 Commits (10+) - [`dbf3b2a`](https://github.com/bitwarden/android/commit/dbf3b2a371af1d658a11cd3cec314ba23f0ce032) [PM-19613] Return server error message to ViewModel error dialog - [`93d7e66`](https://github.com/bitwarden/android/commit/93d7e66652e45b996bfe2c1a7d4b64b9a358610e) [PM-19613] Fix tests - [`8641c32`](https://github.com/bitwarden/android/commit/8641c32719d3fc4825ae153f9ae2307ccfebc29e) Merge branch 'main' into pm-19613/attachment_save_error - [`34b2b94`](https://github.com/bitwarden/android/commit/34b2b94f8997d6039faff54cc5c64889519e7433) [PM-19613] Refactor AttachmentJsonResponse to remove nested class from Success - [`e7079c1`](https://github.com/bitwarden/android/commit/e7079c1367dc41f5b0eec08e2b8ec7497bd00b2a) Merge branch 'pm-19613/attachment_save_error' of https://github.com/bitwarden/android into pm-19613/attachment_save_error - [`9b1f616`](https://github.com/bitwarden/android/commit/9b1f6162e53f9189d5801892676cc44f1ed11fb2) [PM-19613] Move error message to its property - [`cab1908`](https://github.com/bitwarden/android/commit/cab1908742e5d5745150bc76d2aad4ae437e7921) [PM-19613] Add tests - [`9b31ae6`](https://github.com/bitwarden/android/commit/9b31ae682b76102af3dc5f7047c6dd2e3bb225b9) [PM-19613] Fix test - [`004cf36`](https://github.com/bitwarden/android/commit/004cf36c0879db5375a0bb0f00ee3a234ac0fd9b) [PM-19613] Lint - [`dac1274`](https://github.com/bitwarden/android/commit/dac127419b5ea0da989efafb0050ae1eb9e6d98f) Merge branch 'main' into pm-19613/attachment_save_error ### 📊 Changes **13 files changed** (+264 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/model/InvalidJsonResponse.kt` (+3 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/service/CiphersService.kt` (+1 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/service/CiphersServiceImpl.kt` (+15 -7) 📝 `app/src/main/java/com/x8bit/bitwarden/data/vault/manager/CipherManagerImpl.kt` (+29 -5) 📝 `app/src/main/java/com/x8bit/bitwarden/data/vault/repository/model/CreateAttachmentResult.kt` (+4 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsViewModel.kt` (+2 -1) 📝 `app/src/test/java/com/x8bit/bitwarden/data/vault/datasource/network/service/CiphersServiceTest.kt` (+36 -10) 📝 `app/src/test/java/com/x8bit/bitwarden/data/vault/manager/CipherManagerTest.kt` (+14 -7) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsViewModelTest.kt` (+78 -3) 📝 `network/src/main/kotlin/com/bitwarden/network/api/CiphersApi.kt` (+1 -1) 📝 `network/src/main/kotlin/com/bitwarden/network/model/AttachmentJsonResponse.kt` (+38 -11) ➕ `network/src/main/kotlin/com/bitwarden/network/model/InvalidJsonResponse.kt` (+28 -0) 📝 `network/src/testFixtures/kotlin/com/bitwarden/network/model/AttachmentJsonResponseUtil.kt` (+15 -1) </details> ### 📄 Description ## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> https://bitwarden.atlassian.net/browse/PM-19613 ## 📔 Objective <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> When a user with a free organization tries to save an attachment a generic error is shown. Instead we should pass down the error returned from the server. ## 📸 Screenshots <!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. --> https://github.com/user-attachments/assets/ee44bee8-8fa4-4453-af04-04ed9e723b1b ## ⏰ 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 --- <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:59:20 -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#5402