-
Notifications
You must be signed in to change notification settings - Fork 2
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
chore: return lnurlp status and error message when no data can be retrieved #8
base: master
Are you sure you want to change the base?
Conversation
yes, I think error responses for each entry (lnurlp/keysend/nostr) would be good and more consistent there. |
@bumi @im-adithya I have updated the PR. Please re-review when you get the chance |
Example output: {
"lnurlp": {
"allowsNostr": true,
"callback": "https://getalby.com/lnurlp/test/callback",
"commentAllowed": 255,
"maxSendable": 11000000000,
"metadata": "[[\"text/identifier\",\"[email protected]\"],[\"text/plain\",\"Sats for test\"]]",
"minSendable": 1000,
"nostrPubkey": "79f00d3f5a19ec806189fcab03c1be4ff81d18ee4f653c88fac41fe03570f432",
"payerData": {
"email": {
"mandatory": false
},
"name": {
"mandatory": false
},
"pubkey": {
"mandatory": false
}
},
"status": "OK",
"tag": "payRequest"
},
"keysend": {
"customData": [
{
"customKey": "696969",
"customValue": "ZcZq54ODsfKsqaBi74vs"
}
],
"pubkey": "030a58b8653d32b99200a2334cfe913e51dc7d155aa0116c176657a4f1722677a3",
"status": "OK",
"tag": "keysend"
},
"nostr": null,
"errors": {
"lnurlp": null,
"keysend": null,
"nostr": {
"status": 404,
"message": "No details: https://getalby.com/.well-known/nostr.json?name=test - <nil>"
}
}
} |
oha, this got missed. @rolznz @im-adithya are our tools compatible with this? does this break something fro somebody? |
actually shouldn't the errors be nested in lnurlp etc.? |
@bumi what's the benefit of putting the errors inside? now you have to also make sure lnurlp.error is null before using it for example. (This is probably also less likely to be backward compatible than the current solution) |
This should be backward compatible currently, but it will not if we put the errors inside the existing objects (for example |
We can keep it both for a while. but errors within the objects (lnurl, etc.) make most sense, doesn't it? |
@im-adithya @rolznz what do we do here? |
@bumi I think you are right that errors make sense to be inside the objects, however this will break all current versions of alby-tools. So I think we should update alby-tools first to make sure the new format will be handled correctly |
Fixes #7
Currently returns a response like:
I am wondering if it would be better to return a response with errors for each:
What do you guys think?