Skip to content

Move lightning payment filtering to client with settled/pending/expired/failed states #236

@macterra

Description

@macterra

Problem

Lightning payment filtering was done server-side in lnbits.ts, filtering to only status === 'success'. This caused a regression when Drawbridge ran stale code — pending payments leaked through to the UI.

Additionally, the UI had no way to distinguish between settled, pending, failed, or expired payments.

Solution

  • Remove server-side filtering — pass all payments through with full state
  • Extend LightningPaymentRecord type with status and expiry fields
  • Derive display status client-side: settled, pending, failed, or expired
  • expired is derived for any pending payment whose expiry timestamp has passed (incoming or outgoing)
  • Update payments table UI across all four client apps: Date, Amount (sats), Fee, Status, Memo columns with fixed widths (tableLayout: fixed)

Affected files

  • packages/gatekeeper/src/types.ts
  • services/drawbridge/server/src/lnbits.ts
  • apps/react-wallet/src/components/LightningTab.tsx
  • apps/browser-extension/src/components/LightningTab.tsx
  • apps/gatekeeper-client/src/KeymasterUI.jsx
  • apps/keymaster-client/src/KeymasterUI.jsx

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