EN: Empty ?wallet= is forwarded as '' and therefore skips the new DFX Wallet default on mail login.
DE: Ein leeres ?wallet= wird als '' weitergereicht und umgeht damit den neuen DFX-Wallet-Default beim Mail-Login.
Details
Context
Follow-up from review of #1161 (head f64d21e5).
The mail-login default uses nullish coalescing:
// src/components/home/wallet/connect-mail.tsx:70
signInWithMail(mail, redirectUri, recommendationCode, wallet ?? DFX_WALLET_NAME)
?? treats only null/undefined as missing. An empty URL param is preserved as '' and sent to POST /v1/auth/mail unchanged.
Evidence
src/components/home/wallet/connect-mail.tsx:70 — wallet ?? DFX_WALLET_NAME
src/contexts/app-handling.context.tsx:255 — getParameter is query.get(key) ?? undefined, so ?wallet= stays ''
src/contexts/app-handling.context.tsx:358 — that value is stored as wallet
src/__tests__/connect-mail-redirect.test.tsx:155 and :174 cover undefined and 'RealUnit', not ''
This is a pre-existing empty-param path. The PR did not introduce it; it only added a default for absent params. It is not a merge blocker for #1161 — the stated contract is that an explicit ?wallet= is forwarded (??).
Suggested fix
If empty should count as missing:
signInWithMail(mail, redirectUri, recommendationCode, wallet || DFX_WALLET_NAME)
(or, if host-scoping from #1332 lands, only in that branch). Add a unit case with { wallet: '' }.
If empty should stay explicit, no code change — just add the test so the ?? contract is locked in.
Related
EN: Empty
?wallet=is forwarded as''and therefore skips the new DFX Wallet default on mail login.DE: Ein leeres
?wallet=wird als''weitergereicht und umgeht damit den neuen DFX-Wallet-Default beim Mail-Login.Details
Context
Follow-up from review of #1161 (head
f64d21e5).The mail-login default uses nullish coalescing:
??treats onlynull/undefinedas missing. An empty URL param is preserved as''and sent toPOST /v1/auth/mailunchanged.Evidence
src/components/home/wallet/connect-mail.tsx:70—wallet ?? DFX_WALLET_NAMEsrc/contexts/app-handling.context.tsx:255—getParameterisquery.get(key) ?? undefined, so?wallet=stays''src/contexts/app-handling.context.tsx:358— that value is stored aswalletsrc/__tests__/connect-mail-redirect.test.tsx:155and:174coverundefinedand'RealUnit', not''This is a pre-existing empty-param path. The PR did not introduce it; it only added a default for absent params. It is not a merge blocker for #1161 — the stated contract is that an explicit
?wallet=is forwarded (??).Suggested fix
If empty should count as missing:
(or, if host-scoping from #1332 lands, only in that branch). Add a unit case with
{ wallet: '' }.If empty should stay explicit, no code change — just add the test so the
??contract is locked in.Related