New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invoice: Improve expiry display #1534
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shubhamkmr04 Kind of fixing this blindly, please check if it's working now. |
@myxmaster can you fix the conflicts here? This PR will pave the way for this to work with LNDHub and all the other backends #1652 |
95d538f
to
822c268
Compare
Instead of saying |
I understand you want to make clear that it is the time as of now and not as of invoice creation time. The problem is, I can already see trouble for german translation with your suggestion, plus I like to have 'values only' on the right (its very clear structured / easy to read). What about making it clear on the left, where we have text already: Edit: |
822c268
to
f2942b6
Compare
bc7ac62
to
788c8c6
Compare
Invoice details displays both now, "Time until Expiry" and "Original Expiration": As you can see in the screenshot above, there is just one last issue with the calculation of expiry time: 53 years is not correct :) This happens when using LNDhub (via lnbits); LND, CLN, getAlby is fine. Line 240 in ad64b07
|
788c8c6
to
a18ca19
Compare
@myxmaster what's the raw formatting of that timestamp above? |
A fresh lnbits invoice created from Zeus while connected via LNDhub extension has "expiry = 1698222471". Current unix time is ~1698222471, that is the problem (https://www.unixtimestamp.com/). So we have to make clear cases for which Backends use unix time and which expiry in seconds. |
cb920b0
to
4e75cec
Compare
4e75cec
to
ad425a1
Compare
@@ -0,0 +1,223 @@ | |||
// based on light-bolt11-decoder: Copyright (c) 2021 bitcoinjs contributors, fiatjaf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what enhancements have been made here that make it faster than the original library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the docs of the lib:
It doesn't recover payee from signature, doesn't check signature, doesn't parse fallback addresses and doesn't do any encoding
Since the signature wasn't checked before, this is no security downgrade. And checking the signature worsens the performance so much (about 20 times) that the usability would not be acceptable.
Furthermore we removed almost all the parts we don't need for this PR.
ad425a1
to
ec06680
Compare
Looking good, tested on LND and CLN so far. Do we need to display expiry on paid invoices? |
Tested for LND and LNDHub in both iOS and Android. Working fine. |
…iginal expiry for paid invoices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK
Description
Instead of displaying the initially defined time until expiration, the remaining time is now displayed in a human readable form. Also made the layout more consistent by putting labels on the left and values on the right.
Before:
This fixes #1509.
This pull request is categorized as a:
Checklist
yarn run tsc
and made sure my code compiles correctlyyarn run lint
and made sure my code didn’t contain any problematic patternsyarn run prettier
and made sure my code is formatted correctlyyarn run test
and made sure all of the tests passTesting
If you modified or added a utility file, did you add new unit tests?
I have tested this PR on the following platforms (please specify OS version and phone model/VM):
I have tested this PR with the following types of nodes (please specify node version and API version where appropriate):
Locales
Third Party Dependencies and Packages
yarn
after this PR is merged inpackage.json
andyarn.lock
have been properly updatedOther: