lightning-browser-extension icon indicating copy to clipboard operation
lightning-browser-extension copied to clipboard

Delete payments when a publisher allowance is paid

Open bumi opened this issue 4 years ago • 0 comments

Describe the bug

Deleting a publisher (i.e. nakaphoto) does not delete related payments. Currently we only delete the allowance entry not the payments.

Screenshots

  • Delete the nakaphoto entry
  • Payment still visible

To Reproduce

Steps to reproduce the behavior:

  1. Visit 'Websites'
  2. Delete an entry which has payments
  3. Open the popup
  4. Related (outgoing) transactions are still visible

Expected behavior

After deleting a publisher the related payments should be gone as well.

Additional context

  • Allowance delete is happening here:
    https://github.com/getAlby/lightning-browser-extension/blob/master/src/extension/background-script/actions/allowances/delete.ts
  • In case of getting an allowance we're adding related payments here: https://github.com/getAlby/lightning-browser-extension/blob/master/src/extension/background-script/actions/allowances/getById.ts#L32-L36
  • Getting all related payments and delete them: https://dexie.org/docs/Collection/Collection.delete()

This issue is related to #1505

bumi avatar Aug 26 '21 21:08 bumi