rpcserver: fix LSAT issue on account recovery #243
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This problems affected two users who reported on Slack that they were unable to recover their account state.
I've sponsored them an LSAT so they can proceed. This fix should prevent any user with data loss from running into the same problem in the future.
The account recovery process uses a bi-directional streaming RPC on
the server side. Unfortunately, because of the way streaming RPCs
work, the LSAT interceptor isn't able to purchase a token during
a streaming RPC call (the 402/payment required error is only returned
after the interceptor was handed the call, so it cannot act on it
anymore). But since a user that has lost their data most likely als
lost their LSAT, the recovery will fail if this is the first call to
the server ever. That's why we call an RPC that's definitely not on
the white list first to kick off LSAT creation.