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
I'm looking at the paymentRequest function and I find it somewhat confusing.
The payment request has a from and to props. Then we construct a message for the relay server and add counterParty and user that are equal to toand from.
At the end we return basically the const message defined on line 71, but override the direction. Hä, why do we override it? Why do we set the direction to "received" when we send the request to the relay server and then we return direction set to sent?
paymentRequestDecline accepts a counterPartyAddress and an id to decline. Then it returns a message object. The returned id however is set to the id that we are trying to decline. That's confusing - I would expect that paymentRequest and paymentRequestDecline generate different ids. At the end - those are unique actions. They should be connected through the use of a meta flag or a prop such as foreign_id -> to indicate the id of the message deleted.
The message returned from paymentMessage has no idprop at all? For the sake of uniformity I would have an id for paymentMessage as well.
The text was updated successfully, but these errors were encountered:
At the end we return basically the const message defined on line 71, but override the direction. Hä, why do we override it? Why do we set the direction to "received" when we send the request to the relay server and then we return direction set to sent?
I think I wrote that back then, so I can give you an answer for that at least. A message always has a sender and receiver which in our context are users. So if we assume that user A wants to send a payment request to user B, then the direction of that message is different depending on the point of view. User A calls the function which sends the message to user B, so from the point of view of the sender the direction of the returned message is sent. For user B who receives the message the direction is received respectively.
I guess I'm still missing the big picture/context.
A message has a to and from props. So the direction is always from to to from. (😃 wow, that's a funny sentence) Why does the message sent to the relay server needs a direction in the first place?I guess that no matter the direction - it will send it to "to" from "from" 😄
clientlib/src/Messaging.ts
Line 58 in bf78d4d
I'm looking at the paymentRequest function and I find it somewhat confusing.
The payment request has a
from
andto
props. Then we construct a message for the relay server and addcounterParty
anduser
that are equal toto
andfrom
.At the end we return basically the const message defined on line 71, but override the direction. Hä, why do we override it? Why do we set the direction to "received" when we send the request to the relay server and then we return
direction
set tosent
?paymentRequestDecline
accepts acounterPartyAddress
and anid
to decline. Then it returns a message object. The returnedid
however is set to theid
that we are trying to decline. That's confusing - I would expect that paymentRequest and paymentRequestDecline generate different ids. At the end - those are unique actions. They should be connected through the use of a meta flag or a prop such as foreign_id -> to indicate the id of the message deleted.The message returned from paymentMessage has no
id
prop at all? For the sake of uniformity I would have anid
for paymentMessage as well.The text was updated successfully, but these errors were encountered: