-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
LnurlResponse.from_dict incorrectly rejects a valid LUD-06 pay-action callback response when the routes key is absent, raising:
LnurlResponseException: Expected Success or Error response. But no 'status' given.
(Related to lnbits/lnbits#3851)
Expected behaviour
The response is parsed and returned as a LnurlPayActionResponse with routes defaulting to [].
Actual behaviour
from_dict falls through to the status-handling branch and raises:
LnurlResponseException: Expected Success or Error response. But no 'status' given.
Root cause
is_pay_action_response requires both "pr" and "routes" to be present:
def is_pay_action_response(data: dict) -> bool:
return "pr" in data and "routes" in dataLUD-06 specifies routes as an empty array in the success form, but many real-world implementations omit it entirely. The presence of "pr" alone is the correct signal for a pay-action callback.
LnurlPayActionResponse already defines routes with a safe default (routes: list[list[LnurlPayRouteHop]] = []), so parsing a response without routes is safe.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels