-
Notifications
You must be signed in to change notification settings - Fork 285
Manually send order messages and trigger offline message scan #1584
Conversation
Initial conversation around this improvement suggests we will move forward with this PR, pending final peer review of the implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some technical thoughts being mindful of using this solution beyond order messages. Nice schema design upfront. 🤝
…ve of all messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes required here. Please also consider rewriting the godocs so they don't have a hyphen in their description. They should look like:
// FunctionName does some sort of behavior and returns values
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another round of changes to consider.
repo/db/messages_test.go
Outdated
|
||
fmt.Println(string(retMsg.GetPayload().Value), " ", peer) | ||
|
||
if !(string(retMsg.GetPayload().Value) == payload) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You missed this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only other concern which was unaddressed is https://github.com/OpenBazaar/openbazaar-go/pull/1584/files#r301834135 but not worth holding this PR longer. Excellent work here, @amangale.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caught a bug while testing. Please check the comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor nitpicks.
This PR adds order_messages table which is used to store order related messages for a node. It also adds two api end points : GET
/ob/scanofflinemessages
and POST/ob/sendordermessage
to manually trigger offline message scan and send any previously sent order message of type - Message_ORDER, Message_ORDER_REJECT, Message_ORDER_CANCEL, Message_ORDER_CONFIRMATION, Message_ORDER_FULFILLMENT, Message_ORDER_COMPLETION.Fixes #1459
Fixes #1584