[PR #2969] [PM-5896] Fix MAUI iOS Background crash due to lock files on suspension #3922

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

Original Pull Request: https://github.com/bitwarden/android/pull/2969

State: closed
Merged: Yes


Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Fix background crash happening on iOS due to having a lock file (login.png) when the app got to suspended state.
This is due to the CachedImage loading and error placeholders which try to load the login.png file and at the same time the user sends the app to background, and when it reaches the suspended state, sometimes the file is still locked which causes the app to crash afterwards with this reason on the crashlog RUNNINGBOARD 0xdead10cc and this message can be seen on the Console output suspended with locked system files referencing afterwards the login.png file.

Code changes

  • BaseCipherViewCell.cs: Added this class to hold the new logic for the cached image source and visibility changes between the cached image and the placeholder icon. This is shared between CipherViewCell and AuthenticatorViewCell, the two cells that had the issue.
  • CipherViewCell/AuthenticatorViewCell: Implemented the base class and changed the layout a bit so that the placeholder icon (the glyph of this icon is the same as the image login.png) is on top of the cached image to be seen correctly by the user at the proper time. Also added the cached image events so that we can toggle the visibility of the icons accordingly.
  • AppDelegate: Uncommented events upload code given that it didn't have to do with the crash.
  • CipherItemViewModel: Added a new flag IconImageSuccesfullyLoaded which is true when the cached image loads successfully and is checked on binding context changes to prevent odd behaviors on cell reuse.

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team
**Original Pull Request:** https://github.com/bitwarden/android/pull/2969 **State:** closed **Merged:** Yes --- ## Type of change - [X] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Fix background crash happening on iOS due to having a lock file (login.png) when the app got to suspended state. This is due to the `CachedImage` loading and error placeholders which try to load the _login.png_ file and at the same time the user sends the app to background, and when it reaches the suspended state, sometimes the file is still locked which causes the app to crash afterwards with this reason on the crashlog `RUNNINGBOARD 0xdead10cc` and this message can be seen on the Console output `suspended with locked system files` referencing afterwards the _login.png_ file. ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **BaseCipherViewCell.cs:** Added this class to hold the new logic for the cached image source and visibility changes between the cached image and the placeholder icon. This is shared between `CipherViewCell` and `AuthenticatorViewCell`, the two cells that had the issue. * **CipherViewCell/AuthenticatorViewCell:** Implemented the base class and changed the layout a bit so that the placeholder icon (the glyph of this icon is the same as the image `login.png`) is on top of the cached image to be seen correctly by the user at the proper time. Also added the cached image events so that we can toggle the visibility of the icons accordingly. * **AppDelegate:** Uncommented events upload code given that it didn't have to do with the crash. * **CipherItemViewModel:** Added a new flag `IconImageSuccesfullyLoaded` which is `true` when the cached image loads successfully and is checked on binding context changes to prevent odd behaviors on cell reuse. ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team
GiteaMirror added the pull-request label 2025-11-26 23:38:37 -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#3922