Description
On iOS, FlutterContacts.native.showEditor(contactId) presents a CNContactViewController with
allowsEditing = true. On iOS 26+ that editor offers a Delete Contact row at the bottom
(earlier iOS versions don't show it in a third-party editor, which is probably why this hasn't come
up before).
Deleting the contact from that row leaves the app stuck:
-
contactViewController(_:didCompleteWith:) is never called, so the sheet stays on screen
still rendering the contact that was just deleted.
-
The showEditor Future doesn't complete until the user closes the sheet by hand. Because the
controller is presented in editing mode it shows its own ✕ / ✓ items rather than the injected
Done button, so ✕ is what the user ends up tapping — and the Future then resolves to null, the
same value as "cancelled", so the caller has no way to know the contact is gone.
-
Calling showEditor again for that id then throws:
PlatformException(flutter_contacts_error, Updated Record Does Not Exist, null, null)
because store.unifiedContact(withIdentifier:) in ShowEditorImpl.handle fails on the deleted
identifier.
Steps to reproduce
- On iOS 26+,
await FlutterContacts.native.showEditor(contactId: someExistingId).
- Scroll to the bottom of the editor, tap Delete Contact, confirm.
- Observe the sheet stays open on the deleted contact; close it by hand (✕).
- Call
showEditor again with the same id.
Expected
The editor dismisses itself when the contact is deleted from it, and showEditor completes.
Actual
The sheet stays up until the user dismisses it by hand, showEditor resolves to null, and a
second call throws Updated Record Does Not Exist.
Environment
flutter_contacts 2.3.1
- Flutter 3.44.1 (stable)
- iOS 26.3 simulator (iPhone 17 Pro); also seen on a physical device
Fix
PR #249 observes .CNContactStoreDidChange while the editor is presented and dismisses it once the
edited contact no longer resolves. Verified on the iOS 26.3 simulator: delete now closes the sheet,
and normal save / cancel are unchanged.
Description
On iOS,
FlutterContacts.native.showEditor(contactId)presents aCNContactViewControllerwithallowsEditing = true. On iOS 26+ that editor offers a Delete Contact row at the bottom(earlier iOS versions don't show it in a third-party editor, which is probably why this hasn't come
up before).
Deleting the contact from that row leaves the app stuck:
contactViewController(_:didCompleteWith:)is never called, so the sheet stays on screenstill rendering the contact that was just deleted.
The
showEditorFuture doesn't complete until the user closes the sheet by hand. Because thecontroller is presented in editing mode it shows its own ✕ / ✓ items rather than the injected
Done button, so ✕ is what the user ends up tapping — and the Future then resolves to
null, thesame value as "cancelled", so the caller has no way to know the contact is gone.
Calling
showEditoragain for that id then throws:because
store.unifiedContact(withIdentifier:)inShowEditorImpl.handlefails on the deletedidentifier.
Steps to reproduce
await FlutterContacts.native.showEditor(contactId: someExistingId).showEditoragain with the same id.Expected
The editor dismisses itself when the contact is deleted from it, and
showEditorcompletes.Actual
The sheet stays up until the user dismisses it by hand,
showEditorresolves tonull, and asecond call throws
Updated Record Does Not Exist.Environment
flutter_contacts2.3.1Fix
PR #249 observes
.CNContactStoreDidChangewhile the editor is presented and dismisses it once theedited contact no longer resolves. Verified on the iOS 26.3 simulator: delete now closes the sheet,
and normal save / cancel are unchanged.