Skip to content

Handle expired default account edge case #987

@orveth

Description

@orveth

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions