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

Add a way to jumpstart stalled objectives #52

@geoknee

Description

@geoknee

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions