jam icon indicating copy to clipboard operation
jam copied to clipboard

Ability to stop a running taker operation

Open theborakompanioni opened this issue 2 years ago • 8 comments

The only way to stop a running taker operation is to lock the wallet – that is not so intuitive.

At least in regtest, Makers who didnt respond can happen quite often. Should the possibility to stop a single taker operation be considered? In the meantime, the workaround works fine.

theborakompanioni avatar May 16 '22 14:05 theborakompanioni

Yeah definitely. A stop button that calls the '/taker/stop` endpoint would be great.

ghost avatar May 16 '22 16:05 ghost

something like this? https://www.figma.com/file/kfejZJFlwBywvLEnPEmJo1/?node-id=3283%3A85776 if this is ok, then there should be a modal to double check with the user to confirm.

image

editwentyone avatar May 18 '22 20:05 editwentyone

Looks good. I also like what you did with the tabs in that screenshot. 👌✨

ghost avatar May 18 '22 21:05 ghost

An issue we currently have is that we cannot differentiate on the client between the a single collaborative transaction and a schedule of collaborative transactions running. This makes it impossible to treat a single collaborative transaction (Send) and the scheduler (Jam) differently -- therefore anytime either of them is "active" UI-wise, the other one needs to be as well. So we can show a "Stop" button on the send page but it will also show when the scheduler is running, which is weird.

I will check with the backend and see if we can get separate "running" flags for the scheduler and a single collaborative transaction. That will make things a lot easier:

  • Correctly showing the activity indicator. Currently the "Jam" tab is showing indicating activity when a single collaborative transaction is running
  • Showing a stop button on the Send page only when a single collaborative transaction is running
  • Blurring the Send page only when the scheduler is running
  • ...

ghost avatar Jun 10 '22 07:06 ghost

So we can show a "Stop" button on the send page but it will also show when the scheduler is running, which is weird.

Can it be distinguished by checking if an API call to /schedule returns 404 or 200?

  • If taker_running := true and /schedule responds with 404: Send is active.
  • If taker_running := true and /schedule responds with 200: Scheduler is active.

Edit: But you are right, this feels very brittle.

theborakompanioni avatar Jun 10 '22 09:06 theborakompanioni

That's a nice hack. 😉 I think we can get a flag into the /session endpoint quite easily though. I'm already on it. If that doesn't play out for some reason we can still fall back to what you described I'd say.

ghost avatar Jun 10 '22 09:06 ghost

Relevant backend PR that would enable us to differentiate between "Schedule" and "Single Collaborative Transaction": https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/1307

ghost avatar Jun 13 '22 09:06 ghost

As https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/1307 has been merged, this issue is unblocked and can be worked on.

theborakompanioni avatar Aug 08 '22 11:08 theborakompanioni

Tempted to pump this up to 0.1 or at least 0.1.1 - super annoying that you can't stop a running operation yet.

Should be as easy as calling /taker/stop

dergigi avatar Sep 14 '22 12:09 dergigi