[PR #1850] [MERGED] Fix iOS 15.4 crash on adding first item on collection #51395

Closed
opened 2026-05-01 15:06:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1850
Author: @fedemkr
Created: 3/17/2022
Status: Merged
Merged: 3/17/2022
Merged by: @fedemkr

Base: masterHead: fix-ios-15-4-crash-on-first-vault-item


📝 Commits (2)

  • d496284 Fix iOS 15.4 crash from empty list to adding an item by awaiting after every header add; also added that on Settings just in case there is another crash scenario.
  • cefa982 Merge branch 'master' into fix-ios-15-4-crash-on-first-vault-item

📊 Changes

16 files changed (+255 additions, -104 deletions)

View changed files

src/App/Pages/Send/SendGroupingsPage/ISendGroupingsPageListItem.cs (+6 -0)
📝 src/App/Pages/Send/SendGroupingsPage/SendGroupingsPage.xaml (+23 -24)
src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageHeaderListItem.cs (+14 -0)
📝 src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageListItem.cs (+1 -1)
📝 src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageListItemSelector.cs (+6 -0)
📝 src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageViewModel.cs (+30 -3)
📝 src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs (+28 -5)
📝 src/App/Pages/Vault/AutofillCiphersPage.xaml (+21 -22)
📝 src/App/Pages/Vault/AutofillCiphersPageViewModel.cs (+30 -3)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml (+37 -36)
src/App/Pages/Vault/GroupingsPage/GroupingsPageHeaderListItem.cs (+14 -0)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPageListItem.cs (+1 -1)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPageListItemSelector.cs (+6 -0)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs (+31 -4)
src/App/Pages/Vault/GroupingsPage/IGroupingsPageListItem.cs (+6 -0)
📝 src/iOS/AppDelegate.cs (+1 -5)

📄 Description

Type of change

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

Objective

Fix crash produced on iOS 15.4 when adding an item on an empty list: Vault, Send mainly. Also applied the fix on Settings and Autofill Ciphers.
This has a drawback that it takes a bit longer to load the collection and there is an animation when loading the items, but it's something much better than the app crashing. It's because adding a delay between item adding, the crash is related to https://github.com/xamarin/Xamarin.Forms/issues/13323
Also fixed crash when calling base on OpenUrl on AppDelegate

Code changes

  • AppDelegate: Removed call to base on OpenUrl given that that throws an exception for optional iOS method
  • ...xaml: Added common item header template, removed grouping and GroupHeaderTemplate
  • ...Selector: Added the HeaderTemplate and logic to return it depending on the VM item
  • ...ViewModel: Changed logic to use ObservableRangeCollection and on iOS to have a bit of delay after clearing items and also after adding each header that is what is causing the measure crash on iOS 15.4
  • ...ItemViewModel: Added header item VM and also common interface to use on the lists.

Testing requirements

Test that Vault items, Send items, Settings and Autofill ciphers list are loading correctly even if you remove all items so that the list gets empty and also when the list is empty add a new item and test that the app behaves as expected without crashing.

Before you submit

  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

🔄 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/1850 **Author:** [@fedemkr](https://github.com/fedemkr) **Created:** 3/17/2022 **Status:** ✅ Merged **Merged:** 3/17/2022 **Merged by:** [@fedemkr](https://github.com/fedemkr) **Base:** `master` ← **Head:** `fix-ios-15-4-crash-on-first-vault-item` --- ### 📝 Commits (2) - [`d496284`](https://github.com/bitwarden/android/commit/d496284c689637fb2a0351fefef3d549636608cc) Fix iOS 15.4 crash from empty list to adding an item by awaiting after every header add; also added that on Settings just in case there is another crash scenario. - [`cefa982`](https://github.com/bitwarden/android/commit/cefa982792cb51eadaf52e9dfb8aad2f56fee468) Merge branch 'master' into fix-ios-15-4-crash-on-first-vault-item ### 📊 Changes **16 files changed** (+255 additions, -104 deletions) <details> <summary>View changed files</summary> ➕ `src/App/Pages/Send/SendGroupingsPage/ISendGroupingsPageListItem.cs` (+6 -0) 📝 `src/App/Pages/Send/SendGroupingsPage/SendGroupingsPage.xaml` (+23 -24) ➕ `src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageHeaderListItem.cs` (+14 -0) 📝 `src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageListItem.cs` (+1 -1) 📝 `src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageListItemSelector.cs` (+6 -0) 📝 `src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageViewModel.cs` (+30 -3) 📝 `src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs` (+28 -5) 📝 `src/App/Pages/Vault/AutofillCiphersPage.xaml` (+21 -22) 📝 `src/App/Pages/Vault/AutofillCiphersPageViewModel.cs` (+30 -3) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml` (+37 -36) ➕ `src/App/Pages/Vault/GroupingsPage/GroupingsPageHeaderListItem.cs` (+14 -0) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPageListItem.cs` (+1 -1) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPageListItemSelector.cs` (+6 -0) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs` (+31 -4) ➕ `src/App/Pages/Vault/GroupingsPage/IGroupingsPageListItem.cs` (+6 -0) 📝 `src/iOS/AppDelegate.cs` (+1 -5) </details> ### 📄 Description ## 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 crash produced on iOS 15.4 when adding an item on an empty list: Vault, Send mainly. Also applied the fix on Settings and Autofill Ciphers. This has a drawback that it takes a bit longer to load the collection and there is an animation when loading the items, but it's something much better than the app crashing. It's because adding a delay between item adding, the crash is related to https://github.com/xamarin/Xamarin.Forms/issues/13323 Also fixed crash when calling base on `OpenUrl` on `AppDelegate` ## 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--> * **AppDelegate:** Removed call to base on `OpenUrl` given that that throws an exception for optional iOS method * **...xaml:** Added common item header template, removed grouping and `GroupHeaderTemplate` * **...Selector:** Added the `HeaderTemplate` and logic to return it depending on the VM item * **...ViewModel:** Changed logic to use `ObservableRangeCollection` and on iOS to have a bit of delay after clearing items and also after adding each header that is what is causing the measure crash on iOS 15.4 * **...ItemViewModel:** Added header item VM and also common interface to use on the lists. ## Testing requirements <!--What functionality requires testing by QA? This includes testing new behavior and regression testing--> Test that Vault items, Send items, Settings and Autofill ciphers list are loading correctly even if you remove all items so that the list gets empty and also when the list is empty add a new item and test that the app behaves as expected without crashing. ## Before you submit - [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required) - [ ] This change requires a **documentation update** (notify the documentation team) - [ ] This change has particular **deployment requirements** (notify the DevOps team) --- <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-05-01 15:06:08 -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#51395