Skip to content
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

Revert application state changes on failed acknowledgements #107

Merged
merged 13 commits into from
Apr 12, 2021
Prev Previous commit
Next Next commit
add note for async acks
  • Loading branch information
colin-axner committed Apr 12, 2021
commit 3111c1d4fbe9844d993d9eb318793788cd3e1b98
4 changes: 4 additions & 0 deletions docs/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ The state changes that occurred during this callback will only be written if:
- the acknowledgement was successful as indicated by the `Success()` function of the acknowledgement
- if the acknowledgement returned is nil indicating that an asynchronous process is occurring
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So anyone using async acks will have to take care to revert state themselves. This should be documented

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note. Going to merge this pr, feel free to open an issue or comment here if you think it could use more information


NOTE: Applications which process asynchronous acknowledgements must handle reverting state changes
when appropriate. Any state changes that occurred during the `OnRecvPacket` callback will be written
for asynchronous acknowledgements.

```go
OnRecvPacket(
ctx sdk.Context,
Expand Down