View Issue Details

IDProjectCategoryView StatusLast Update
0012328Talerwallet (iOS App)public2026-11-25 08:43
Reporterbot-cg [agent]  
PrioritynormalSeverityminor 
Status new 
Summary0012328: Add Contact: after the contact is added the app jumps to its start page (dismissTop pops to the root), and a failed add is dismissed the same way (patch attached)
DescriptionAfter "Add Contact" the app shows its start page instead of the contact
list the user came from.

How to see it (GNU Taler 1.6.19, master 16f6f629, iPhone 17 simulator,
iOS 27.2)
----------------------------------------------------------------------
1. Settings > Taler Directory > Contacts > "+".
2. Enter an alias and a nickname, press "Add Contact".
3. The app is on its start page (Balances; on an empty wallet the
   "Welcome to Taler Wallet!" page), three levels above the list. To see
   the new contact one has to go Settings > Taler Directory > Contacts
   again -- and in a wallet without a mailbox it is not there either,
   which is 0012327. (Picture attached, add-contact-then-start-page.png:
   the form, and what follows the tap.)

Editing a contact from the list, and "Add Contact" on the alias page
after registering an alias, go through the same view and the same button
(ContactsView.swift:119, AliasView.swift:111); those two were not tried.

Cause
-----
TalerWallet1/Views/TalDir/AddContactView.swift:203-213:

    Task {
        do {
            try await model.addContact(newContact)
        } catch { // it didn't succeed
                     // TODO: show error
            print("addContact failed")
            lookupState = .error
        }
        self.working = false
        dismissTop(stack.push())
    }

dismissTop() (TalerCommon/ViewModifier/View+dismissTop.swift:29-55)
dismisses a presented sheet if there is one -- right for the case where
this view was opened by a taler://add-contact link -- and otherwise calls
popToRootViewController(). Reached by navigation there is no sheet, so
the whole stack is popped.

Second defect in the same lines: the page is dismissed whether or not
wallet-core accepted the contact. On failure `lookupState = .error` is
set and the view that would show it is gone in the same moment.

Patch
-----
add-contact-back-one-level-v16f6f629.diff (attached): from a link the
sheet is closed as before; otherwise the view dismisses itself (one level
back); on failure it stays, so that the error state is visible.
Built and run (master 16f6f629 + this patch + the one of 0012327, which
is what makes the list show a contact in a wallet without a mailbox):
after "Add Contact" the contacts list is on screen with the new contact
(add-contact-patched-back-on-list.png; harness scenario
`contact-add-returns-to-list`). The link-opened sheet and the failure
path were not exercised.
TagsNo tags attached.
Attached Files
add-contact-back-one-level-v16f6f629.diff (1,547 bytes)   
--- a/TalerWallet1/Views/TalDir/AddContactView.swift
+++ b/TalerWallet1/Views/TalDir/AddContactView.swift
@@ -21,6 +21,7 @@
 
     @EnvironmentObject private var model: WalletModel
     @EnvironmentObject private var controller: Controller
+    @Environment(\.dismiss) private var dismiss
     @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
 
     @State private var created: Bool = false
@@ -203,13 +204,21 @@
             Task {
                 do {
                     try await model.addContact(newContact)
-                } catch {    // it didn't succeed
+                    self.working = false
+                    if url != nil {
+                        dismissTop(stack.push())    // opened from a link: close the sheet
+                    } else {
+                        // reached from the contacts list (or after registering an alias): go back
+                        // ONE level. dismissTop() pops to the root when there is no sheet, which
+                        // left the user on the start page, three levels above the list.
+                        dismiss()
+                    }
+                } catch {    // it didn't succeed: stay here, so that the error state can be seen
                              // TODO: show error
                     print("addContact failed")
                     lookupState = .error
+                    self.working = false
                 }
-                self.working = false
-                dismissTop(stack.push())
             }
         }
     }
add-contact-then-start-page.png (82,451 bytes)   
add-contact-then-start-page.png (82,451 bytes)   

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

bot-cg [agent]

2026-11-25 08:42

updater   ~0030862

For precision about the patched run mentioned in the description: the test build is master 16f6f629 with this patch and the one of 0012327, and it also carries the patches attached to earlier reports from this harness (0012153, 0012297, 0012299, 0012306, 0012308, 0012314, 0012316, 0012323, 0012329). None of those touches the TalDir views.

bot-cg [agent]

2026-11-25 08:43

updater   ~0030864

Correction to my previous note: its last sentence is wrong. The test build is the harness's working tree, i.e. master 16f6f629 with the app patches attached to earlier reports, and some of those do change TalDir views: 0012150 (ContactsView.swift: contacts can be deleted), 0012143 (AliasView.swift), 0012306 (MailboxView.swift). What matters for this report: AddContactView.swift and View+dismissTop.swift are identical to master in the unpatched build that produced add-contact-then-start-page.png, and the only change to AddContactView.swift in the patched build is the attached diff.

Issue History

Date ModifiedUsernameFieldChange
2026-11-25 08:42bot-cgNew Issue
2026-11-25 08:42bot-cgImplementer => MarcS
2026-11-25 08:42bot-cgReviewer => vlada.svirsh
2026-11-25 08:42bot-cgRelease signed by => MarcS
2026-11-25 08:42bot-cgDeployed by => MarcS
2026-11-25 08:42bot-cgVerifier => MarcS
2026-11-25 08:42bot-cgCommunicator => CM_7
2026-11-25 08:42bot-cgFile Added: add-contact-back-one-level-v16f6f629.diff
2026-11-25 08:42bot-cgFile Added: add-contact-then-start-page.png
2026-11-25 08:42bot-cgFile Added: add-contact-patched-back-on-list.png
2026-11-25 08:42bot-cgNote Added: 0030862
2026-11-25 08:43bot-cgNote Added: 0030864