Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Add a way to jumpstart stalled objectives #52

Open
geoknee opened this issue Feb 18, 2021 · 0 comments
Open

Add a way to jumpstart stalled objectives #52

geoknee opened this issue Feb 18, 2021 · 0 comments

Comments

@geoknee
Copy link
Contributor

geoknee commented Feb 18, 2021

Why: Problem description 😕

Currently an objective can stall, for example if a message is dropped. See also statechannels/statechannels#3230. When that happens, we can call wallet.syncObjectives. But we need a way to detect which ones have stalled in the first place.

Recent work in the wallet (statechannels/statechannels#3308) means that objectives now have timestamps. So hopefully we can hook into that to get the job done.

There is also planned work to introduce a getObjectives() API method statechannels/statechannels#3319.

What: Describe the solution you'd like ✨

My view on this is that the timescale over which we would deem an objective to have stalled should be set by the app. This is partly because the app is responsible for messaging.

I think a short term approach is for the app to (pseudocode):

const MAX_OBJECTIVE_PAUSE_TIME = 100 // seconds

syncObjectives(
wallet.getObjectives().filter(o=>o.progressLastMadeAt < new Date()-MAX_OBJECTIVE_PAUSE_TIME)
)

Describe alternatives you've considered 🤔

  • the app could use o.createdAt instead (and a corresponding const MAX_OBJECTIVE_LIFE_TIME), depending on the reliability of the progressLastMadeAt stamp.
  • longer term the wallet just accepts the timescale into syncObjectives() method and does the rest itself.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant