event icon indicating copy to clipboard operation
event copied to clipboard

ZEUS-1934: Payment: Move noteKey logic to model

Open kaloudis opened this issue 5 months ago • 1 comments

Description

Relates to issue: ZEUS-1934

Moves the noteKey logic for payment objects to the model.

This remedies a regression where notes added on the SendingLightning success screen were not being saved properly - may have been a regression from https://github.com/ZeusLN/zeus/pull/1920

This pull request is categorized as a:

  • [ ] New feature
  • [X] Bug fix
  • [X] Code refactor
  • [ ] Configuration change
  • [ ] Locales update
  • [ ] Quality assurance
  • [ ] Other

Checklist

  • [ ] I’ve run yarn run tsc and made sure my code compiles correctly
  • [X] I’ve run yarn run lint and made sure my code didn’t contain any problematic patterns
  • [X] I’ve run yarn run prettier and made sure my code is formatted correctly
  • [X] I’ve run yarn run test and made sure all of the tests pass

Testing

If you modified or added a utility file, did you add new unit tests?

  • [ ] No, I’m a fool
  • [ ] Yes
  • [X] N/A

I have tested this PR on the following platforms (please specify OS version and phone model/VM):

  • [ ] Android
  • [X] iOS

I have tested this PR with the following types of nodes (please specify node version and API version where appropriate):

  • [ ] Embedded LND
  • [X] LND (REST)
  • [ ] LND (Lightning Node Connect)
  • [ ] Core Lightning (c-lightning-REST)
  • [ ] LndHub
  • [ ] [DEPRECATED] Core Lightning (Spark)
  • [ ] [DEPRECATED] Eclair

Locales

  • [ ] I’ve added new locale text that requires translations
  • [ ] I’m aware that new translations should be made on the ZEUS Transfix page and not directly to this repo

Third Party Dependencies and Packages

  • [ ] Contributors will need to run yarn after this PR is merged in
  • [ ] 3rd party dependencies have been modified:
    • verify that package.json and yarn.lock have been properly updated
    • verify that dependencies are installed for both iOS and Android platforms

Other:

  • [ ] Changes were made that require an update to the README
  • [ ] Changes were made that require an update to onboarding

kaloudis avatar Feb 29 '24 22:02 kaloudis

cc @myxmaster

kaloudis avatar Feb 29 '24 22:02 kaloudis

Refactor looks good, but I don't see how this fixes the "regression" (not really a regression because it was buggy before, and only because it is handled correctly now, that old bug can become visible...).

The (not very relevant) problem is: Before, when a paymentHash could not be used as noteKey (because of the bug), the preimage was used instead. In such cases we are now using the "wrong" noteKey (paymentHash and not preimage) for the query. Question is if it is worth it to fix it at all, over time this will become completely irrelevant.

Anyway, this PR lgtm.

myxmaster avatar Mar 03 '24 12:03 myxmaster