Skip to content
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

Wallet send+recv status derived from logs #1559

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Conversation

ekzyis
Copy link
Member

@ekzyis ekzyis commented Nov 8, 2024

Description

For now, this simply uses the most recent log that has context.status set to derive the status. context.status is set if context.bolt11 is set to make sure only payments affect status.

Close #1490 Based on #1588 Related to #1495

TODO:

Screenshots

2024-11-13-220522_1920x1080_scrot

2024-11-13-222833_1920x1080_scrot

Video

2024-11-15.01-08-14.mp4

Additional Context

  1. I like the grey background for the icons in this:

2024-11-13-223506_173x199_scrot

more than this:

382002204-ecc2d9aa-2781-4eda-a4f8-1af5dfa81552

even though it started as an accident.

  1. I am setting context.recv = true in the walletLogger (the function) such that every log in the db will have recv: true inserted in the database. We could instead rely on !context.send or simply add context.recv to all logs before returning them to the client.

  2. Aspect ratio of logos are different but all images use width='100%' which means that an image with a higher height/width ratio appears bigger. Good example is the LND logo on the config page since it's more a square.

Checklist

Are your changes backwards compatible? Please answer below:

yes, context.status + context.send or context.recv is only used to derive wallet status. If no log has this set, the wallet status for send/recv only depends on if the wallet is configured.

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:

8. See video for Q&A of LNbits. I also tested NWC. I also tested reordering and saving combinations of send/recv.

For frontend changes: Tested on mobile? Please answer below:

n/a

Did you introduce any new environment variables? If so, call them out explicitly here:

no

@ekzyis ekzyis added feature new product features that weren't there before wallets labels Nov 8, 2024
@ekzyis ekzyis marked this pull request as draft November 8, 2024 21:23
@ekzyis ekzyis changed the title Wallet status derived from logs, separate status for send and recv Wallet send+recv status derived from logs Nov 8, 2024
@ekzyis ekzyis force-pushed the wallet-logs-status branch 2 times, most recently from 2ed4391 to fc316a6 Compare November 12, 2024 16:18
@ekzyis ekzyis force-pushed the wallet-logs-status branch 3 times, most recently from c1ccff1 to ce852dd Compare November 13, 2024 16:44
@ekzyis ekzyis marked this pull request as ready for review November 14, 2024 02:38
@ekzyis ekzyis requested a review from huumn November 14, 2024 02:45
components/log-message.js Outdated Show resolved Hide resolved
@@ -11,7 +11,7 @@ export default function WalletButtonBar ({
return (
<div className={`mt-3 ${className}`}>
<div className='d-flex justify-content-between'>
{isConfigured(wallet) &&
{isConfigured(wallet) && wallet.def.requiresConfig &&
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like that WebLN always showed detach. This fixes it by only showing it if there's actually something to delete.

wallets/lnbits/client.js Outdated Show resolved Hide resolved
@ekzyis ekzyis marked this pull request as draft November 14, 2024 03:23
@ekzyis ekzyis marked this pull request as ready for review November 15, 2024 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new product features that weren't there before wallets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wallet status derived from wallet logs
1 participant