View Issue Details

IDProjectCategoryView StatusLast Update
0012143Talerwallet (iOS App)public2026-11-15 20:03
Reporterbot-cg [agent]  
ImplementerMarcS  
PrioritynormalSeverityminor 
Status implementing 
Target Version1.7 
Summary0012143: Alias Registration says "valid for 0 days" right after registering an alias for a year: confirmButton sets a literal zero duration (patch attached)
DescriptionRight after an alias has been registered for one year and confirmed with
the code from the mail, the Alias Registration screen says

    "This alias, valid for 0 days, is already registered to the mailbox on
     this phone."

(alias-valid-for-0-days.jpg). A user reads that as "it has already expired".

Steps (iOS 27.2 simulator): Settings -> Taler Directory -> create a mailbox
-> Alias Registration -> enter an e-mail alias -> Lookup Alias -> Register
Alias -> type the code from the mail -> Confirm.

The registration itself is fine; the app asked for a year:

    registerAlias{"alias":"talerfuzz+58266@...","duration":{"d_us":31536000000000}, ...}

Cause (AliasView.swift, confirmButton): on success the state is set with a
literal zero duration, and the text prints it:

    try await model.completeRegisterAlias(register)
    lookupState = targetUri.isEmpty ? .unregistered
                                    : .confirmed(targetUri, Duration.microseconds(0))
    ...
    Text("This alias, valid for \(validFor.toDays()) days, is already registered ...")

Leaving the screen and looking the alias up again shows the real value,
because LookupButton takes validFor from the lookupAlias response.

Patch attached (alias-valid-for-0-days.diff, not build-verified): pass the
validity the view already stores from the registerAlias response
(`validFor`) instead of zero. Two things the patch does not cover and which
may be worth a look while there:
 - registerButton sets `.registered(targetUri, Duration.microseconds(0))`
   in the same way, and AddContactView does it in two places;
 - when no validity is known at all, the sentence should not print a number
   of days rather than print 0.

Found by the UI fuzz harness, scenario p2p-send-via-mailbox, 2026-11-15.
TagsNo tags attached.
Attached Files
alias-valid-for-0-days.jpg (37,400 bytes)   
alias-valid-for-0-days.jpg (37,400 bytes)   
12143-alias-valid-for-0-days.diff (808 bytes)   
diff --git a/TalerWallet1/Views/TalDir/AliasView.swift b/TalerWallet1/Views/TalDir/AliasView.swift
index c699c843..6e4abb98 100644
--- a/TalerWallet1/Views/TalDir/AliasView.swift
+++ b/TalerWallet1/Views/TalDir/AliasView.swift
@@ -91,7 +91,7 @@ struct AliasView: View {
                     try await model.completeRegisterAlias(register)
                     challenge = EMPTYSTRING
                     lookupState = targetUri.isEmpty ? .unregistered
-                                                    : .confirmed(targetUri, Duration.microseconds(0))
+                                                    : .confirmed(targetUri, validFor ?? Duration.microseconds(0))
                 } catch {    // it didn't succeed
                     // TODO: show error
                     print("confirm failed")

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

bot-cg [agent]

2026-11-15 16:29

updater   ~0030522

Correction: the patch first attached (12143-alias-valid-for-0-days.diff) does
NOT fix this. I built it and ran the flow: the screen still said "valid for
0 days". It reused the view's `validFor`, which is set from the
registerAlias response -- and that response carries no validity here (the
directory answers 202 Accepted), so the value is nil. Please ignore that
file; I cannot delete it.

12143-alias-valid-for-0-days-v2.diff is the one to look at. It remembers the
duration the app itself asked for in registerAlias and uses it when the
response has none. Built (BUILD SUCCEEDED, Debug, iOS simulator) and run
through the same flow on 2026-11-15: the screen now reads "This alias, valid
for 365 days, is already registered to the mailbox on this phone."
(alias-valid-365-days-patched.jpg).
12143-alias-valid-for-0-days-v2.diff (1,677 bytes)   
diff --git a/TalerWallet1/Views/TalDir/AliasView.swift b/TalerWallet1/Views/TalDir/AliasView.swift
index c699c843..c7207e40 100644
--- a/TalerWallet1/Views/TalDir/AliasView.swift
+++ b/TalerWallet1/Views/TalDir/AliasView.swift
@@ -30,6 +30,7 @@ struct AliasView: View {
     @State private var challenge: String = EMPTYSTRING
     @State private var aliasTypes: [TaldirAliasType]? = nil
     @State private var validFor: Duration? = nil
+    @State private var requestedFor: Duration? = nil     // what registerAlias asked for
     @State private var addContact: Bool = false
 //    @ScaledMetric var frameHeight: CGFloat = 40          // relative to fontSize
 
@@ -61,6 +62,7 @@ struct AliasView: View {
                                            duration: Duration.microseconds(microSeconds))
             Task {
                 do {
+                    requestedFor = hasTarget ? nil : Duration.microseconds(microSeconds)
                     if let result = try await model.registerAlias(register) {
                         validFor = result
                     } else {
@@ -91,7 +93,7 @@ struct AliasView: View {
                     try await model.completeRegisterAlias(register)
                     challenge = EMPTYSTRING
                     lookupState = targetUri.isEmpty ? .unregistered
-                                                    : .confirmed(targetUri, Duration.microseconds(0))
+                                                    : .confirmed(targetUri, validFor ?? requestedFor ?? Duration.microseconds(0))
                 } catch {    // it didn't succeed
                     // TODO: show error
                     print("confirm failed")

Issue History

Date ModifiedUsernameFieldChange
2026-11-15 16:00bot-cgNew Issue
2026-11-15 16:00bot-cgCommunicator => CM_7
2026-11-15 16:00bot-cgFile Added: alias-valid-for-0-days.jpg
2026-11-15 16:00bot-cgFile Added: 12143-alias-valid-for-0-days.diff
2026-11-15 16:29bot-cgFile Added: 12143-alias-valid-for-0-days-v2.diff
2026-11-15 16:29bot-cgFile Added: alias-valid-365-days-patched.jpg
2026-11-15 16:29bot-cgNote Added: 0030522
2026-11-15 20:03Christian GrothoffImplementer => MarcS
2026-11-15 20:03Christian GrothoffReviewer => schanzen
2026-11-15 20:03Christian GrothoffRelease signed by => MarcS
2026-11-15 20:03Christian GrothoffDeployed by => MarcS
2026-11-15 20:03Christian GrothoffVerifier => schanzen
2026-11-15 20:03Christian GrothoffStatusnew => implementing
2026-11-15 20:03Christian GrothoffTarget Version => 1.7