-
Notifications
You must be signed in to change notification settings - Fork 34
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
[ANCHOR-793] Update customer callback logic and implementation #1475
Comments
Why do we need the flag? If the AP sets the flag to |
In the sync case, what do we do if the BS calls the RPC? Can we elaborate? |
We don't need to do anything, it's not a problem if BS calls the RPC. We just note in docs, that BS should not call RPC in the sync case (if they do, it will just create a duplicate event, that's it) |
It's in the response of business server, we don't know the value of it ahead of time |
I propose that we only publish the customer callback in the This should prevent duplicated events. |
Background information
Currently, there are a few flaws with customer callback logic:
First,
Business server must always call
notify_customer_info_updated
on status update, even if the original request comes from the Anchor Platform, as part ofPUT
callback. If business doesn't call RPC, transaction status is not updated appropriately.We make a callback to wallet both in RPC and in
PUT /customer
that leads to duplicate update on the wallet size.Second, according to the SEP-12 spec, we should only send callbacks when status has been changed. Currently, we send callback on any
PUT
request and any RPC call (that is also done as part ofPUT
request handling).Business server
PUT
callback proposal changeWe propose to change
PUT
callback for the business server. It should now return full Customer body response. This will allow us to not require business to call RPC on sync updates anymore. Instead, we can perform the same logic inPUT
handler (update transaction status)Second, we should add a new required boolean field to Business Server
PUT
callback response (status_updated
). When set totrue
, we will fire an customer status change event. If set tofalse
, nothing happens.In return, as RPC is used to sync updates, we should always fire customer status change events (the way it's done now)
The text was updated successfully, but these errors were encountered: