Skip to content

Automatic timeout detection + session cleanup #148

Description

@ermeme

Milestone: 3 — Protocol gaps
Type: protocol
Priority: medium

There is no logic that detects expired sessions and cleans them up. After a take attempt times out, after an order expires, after a session goes stale — the entries remain in the DB and continue to be loaded into providers. v1 documents this in TIMEOUT_DETECTION_AND_SESSION_CLEANUP.md and has dedicated logic for it.

Scope

  • Periodic sweep (on app start + at low frequency thereafter) that:
    • Marks orders past expires_at as expired.
    • Cleans sessions whose underlying trade has been in a terminal state for > N days.
    • Does not delete dispute sessions early (related to bond defer behavior — separate issue).
  • Surface counters in the logs / debug screen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions