You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CustomOnionMessageHandler::handle_message doesn't expose the reply_path #2882
I'm trying to implement an onion message handler that does some work async and then eventually replies to an onion message. However, handle_message currently only exposes the message itself but not the reply path, which would be needed to be able to respond async. To avoid cloneing the BlindedPath in such a case, maybe it makes sense to drop the whole reply-inline logic and force users to reply via release_pending_custom_messages?
Not 100% sure. I was thinking those first two methods would essentially act as callbacks to OnionMessenger::handle_onion_message_response. (Note that we'll need the second method for OffersMessageHandler when responding with an invoice plus reply path, so this isn't only applicable to custom messages.) Then the message handler would no longer have a return value since responding async wouldn't require one. But I can see there being other ways of formulating this.
Activity
jkczyz commentedon Feb 7, 2024
Hmm... possibly though it would be nice to have some optionality here. We could pass the handler an object that has methods like:
respondfor handling the current caserespond_with_reply_pathfor giving a reply path in the response (needed for proper invoice error handling still)defer(or something) to consume the object and obtain the reply path, path_id, etc.TheBlueMatt commentedon Feb 7, 2024
That seems sensible, and then the method would return a
PendingOnionMessage<Self::CustomMessage>rather than aSelf::CustomMessage?jkczyz commentedon Feb 7, 2024
Not 100% sure. I was thinking those first two methods would essentially act as callbacks to
OnionMessenger::handle_onion_message_response. (Note that we'll need the second method forOffersMessageHandlerwhen responding with an invoice plus reply path, so this isn't only applicable to custom messages.) Then the message handler would no longer have a return value since responding async wouldn't require one. But I can see there being other ways of formulating this.TheBlueMatt commentedon Feb 9, 2024
Yea, I don't really have much of an opinion on how this should look, any of those seem reasonable to me.
shaavan commentedon Feb 15, 2024
Quick heads up, I'm actively tackling this issue now. Will update as soon as I make some good progress!