-
Notifications
You must be signed in to change notification settings - Fork 59
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
Normalize final states for cancelled retrieval deals #464
Normalize final states for cancelled retrieval deals #464
Conversation
…for retrieval clients
ee2bff5
to
2617dcc
Compare
Codecov Report
@@ Coverage Diff @@
## master #464 +/- ##
==========================================
+ Coverage 65.51% 65.58% +0.07%
==========================================
Files 46 46
Lines 3198 3198
==========================================
+ Hits 2095 2097 +2
+ Misses 877 875 -2
Partials 226 226
Continue to review full report at Codecov.
|
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.
One question but looks great 🎉
DealStatusSendFunds | ||
|
||
// DealStatusSendFundsLastPayment indicats the client is now going to send final funds because |
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.
indicats! 🐱
fsm.Event(rm.ClientEventCancel).FromAny().To(rm.DealStatusCancelling).Action(func(deal *rm.ClientDealState) error { | ||
deal.Message = "Retrieval Cancelled" | ||
deal.Message = "Client cancelled retrieval" |
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.
I think that the provider can also cancel the deal - are we guaranteed to only get to this action if the client cancels?
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.
Yeah, when the provider cancels it comes from the data transfer event, translated into the ClientEventProviderCancelled
event.
Problem
A retrieval deal can be cancelled by either the client or provider. The deals, when cancelled, were either going to error states or cancelled states depending on if you were a client or provider. In addition, this state transition was done without cleaning up the tracking, closing channels, etc.
Solution
Make all deals that are "cancelled" by either the client or provider have a final state of
DealStatusCancelled
, with the reason for the cancel stored in themsg
field.