Problem
#984 introduces account expiry
getDefaultAccount() in user-repository.ts doesn't filter by state = 'active'. If a default account expires, the server-side lightning address handler (lightning-address-service.ts:181) would receive into an expired account — funds land but don't appear in the UI.
Not a problem today — only offer accounts expire, and offer accounts can't be set as default. But this becomes a risk if default account rules change.
Client-side useDefaultAccount() is safe — it reads from getAll() which filters to active, with fallback logic.
Options
- A. Filter in query — add
state = 'active' filter to getDefaultAccount(), fail cleanly if expired
- B. Disallow expiring defaults — enforce at the "set default" mutation (offer accounts can't be default)
- C. Revisit later — current constraints prevent this from happening
Current decision
Option C for v1. Revisit when account type rules change.
Problem
#984 introduces account expiry
getDefaultAccount()inuser-repository.tsdoesn't filter bystate = 'active'. If a default account expires, the server-side lightning address handler (lightning-address-service.ts:181) would receive into an expired account — funds land but don't appear in the UI.Not a problem today — only offer accounts expire, and offer accounts can't be set as default. But this becomes a risk if default account rules change.
Client-side
useDefaultAccount()is safe — it reads fromgetAll()which filters to active, with fallback logic.Options
state = 'active'filter togetDefaultAccount(), fail cleanly if expiredCurrent decision
Option C for v1. Revisit when account type rules change.