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

Add a stream PurchaseTicket grpc call. #2296

Open
amass01 opened this issue Nov 9, 2023 · 3 comments
Open

Add a stream PurchaseTicket grpc call. #2296

amass01 opened this issue Nov 9, 2023 · 3 comments

Comments

@amass01
Copy link
Member

amass01 commented Nov 9, 2023

Currently the PurchaseTicket grpc returns one response when it's done. Because of this limitation the ticket purchase
UX in decrediton is not smooth as users don't get any feedback during the process. See decred/decrediton#3926.

We would like to add a stream grpc call, which will allow us return various statuses during the process and would make the call cancellable.

@alexlyp @jrick Any idea which statuses would be helpful here, I will inspect the current func flow and see at which
stages it would make sense to return an update to the consumer.

@jrick
Copy link
Member

jrick commented Nov 9, 2023

The call should already be cancellable. Are you seeing otherwise?

I assume this request is mostly about mixed ticket buying, because of the potentially long wait period for a mix to occur? There is not much other information to provide during this.

@amass01
Copy link
Member Author

amass01 commented Nov 9, 2023

The call should already be cancellable. Are you seeing otherwise?

Oh yea haven't tried, probably it's cancellable, but not in the GUI, how does the cancel work ? is it by context cancellation ?

I assume this request is mostly about mixed ticket buying, because of the potentially long wait period for a mix to occur? There is not much other information to provide during this.

Yes, so probably we can return when mixing started and mixed balance / ticket price each time the mixed balance changes ?

@jrick
Copy link
Member

jrick commented Nov 10, 2023

The call should already be cancellable. Are you seeing otherwise?

Oh yea haven't tried, probably it's cancellable, but not in the GUI, how does the cancel work ? is it by context cancellation ?

Yep, with the context. I'm not sure how this works on the javascript side, but you should be able to cancel a specific ongoing request.

I assume this request is mostly about mixed ticket buying, because of the potentially long wait period for a mix to occur? There is not much other information to provide during this.

Yes, so probably we can return when mixing started and mixed balance / ticket price each time the mixed balance changes ?

I'm not sure what you mean by mixed balance. If you mean the ticket price it buys at, and the (slightly higher) value of the mixed outputs from the split tx, this doesn't change over the duration of the call. The request should error out if the ticket price changes because the window rolls over. I know the autobuyer does this, but I think calling PurchaseTickets directly might not (the mix might still complete, but the ticket purchase would fail).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants