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

PaychGet has poor usability #2295

Open
raulk opened this issue Jul 7, 2020 · 7 comments
Open

PaychGet has poor usability #2295

raulk opened this issue Jul 7, 2020 · 7 comments
Assignees
Labels
area/payment-channel Area: Payment Channel kind/enhancement Kind: Enhancement need/analysis Hint: Needs Analysis P3 P3: Might get resolved

Comments

@raulk
Copy link
Member

raulk commented Jul 7, 2020

Description

PaychGet has poor usability. It either gets or creates the channel. The last parameter is called ensureFunds, which makes me think it’ll do an “upsert” ensuring that at least that much funds are available.

What it in fact does is:

  • if the channel doesn’t exist, it creates it and funds it with ensureFunds.
  • if the channel exists, it adds ensureFunds to it.

This is poor UX because it creates a catch-22 situation.

Say I know I want a channel between A and B with N funds. I know my balance, but I don’t know if the payment channel exists beforehand, and the very method that lets me query that will actually create the channel for me. The only deterministic way to use this is by setting ensureFunds=0, which defeats the purpose of this field altogether.

Possible solution

The ideal solution is to make this method behave like advertised (ensuring that N funds exists in the channel), but there may be timing conditions with messages appearing on chain, yada-yada-yada.

@daviddias daviddias added the P3 P3: Might get resolved label Aug 3, 2020
@dirkmc
Copy link
Contributor

dirkmc commented Aug 4, 2020

The UX is definitely a little confusing here.

We're actually changing this so that the last parameter is called Amt.
The reason that we always want to increase the total amount in the payment channel is to satisfy the following use case:

  • In one process Alice wants to create deal 1 with Bob worth 5 FIL
  • In another process Alice wants to create deal 2 with Bob worth 7 FIL

We want the total amount reserved in the channel to be 12 FIL (enough for both deals).

I think it may make most sense to

  1. Change the name of the API call to make it clear what it's doing
  2. Add another API call that allows a client to check if there's a channel between from -> to, and how much is in the channel

Do we currently have a use case for point 2 above?

@hoffmabc
Copy link
Contributor

I'm not sure what you'd change the name to. PaychNew or PaychCreate would make sense if it didn't also provide the ability to top up a channel. Maybe that's an ok name, something like PaychTopoff or PaychDeposit.

I definitely think there's a demand for use case #2.

@ghost
Copy link

ghost commented Aug 25, 2020

I found this confusing at first too. Maybe PaychGetOrCreate could make this clearer to users?

+1 on Amt

@dirkmc
Copy link
Contributor

dirkmc commented Sep 2, 2020

#3448 provides the ability to find out how much available funds there are for a given from / to combination

@TippyFlitsUK
Copy link
Contributor

Hi @raulk

This issue has not been updated in some time. Should we close it or keep it open?

@TippyFlitsUK TippyFlitsUK added kind/enhancement Kind: Enhancement need/author-input Hint: Needs Author Input area/payment-channel Area: Payment Channel labels Mar 30, 2022
@raulk
Copy link
Member Author

raulk commented Mar 30, 2022

I don't have the bandwidth to verify if the concerns are resolved. @TippyFlitsUK is this something you can test yourself and see if the UX is more coherent now?

@TippyFlitsUK
Copy link
Contributor

Leave it to me @raulk . Many thanks for your confirmation!!

@TippyFlitsUK TippyFlitsUK added need/analysis Hint: Needs Analysis and removed need/author-input Hint: Needs Author Input labels Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/payment-channel Area: Payment Channel kind/enhancement Kind: Enhancement need/analysis Hint: Needs Analysis P3 P3: Might get resolved
Projects
None yet
Development

No branches or pull requests

6 participants