Skip to content

Replaying the event log results in "expired" error for successfully completed sessions #1651

Description

@spacebear21
❯ cargo run -- history
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.12s
     Running `/Users/spacebear/Projects/rust-payjoin/target/debug/payjoin-cli history`
Session ID   Sender/Receiver           Completed At    Status
25           Receiver                  Not Completed   Session expired at Time(Time(1778362082))
1            Receiver                  1778275755      Session expired at Time(Time(1761155560))
2            Receiver                  1778275755      Session expired at Time(Time(1761234352))

Sessions 1 and 2 were completed but display the "expired" status erroneously.

Activity

  1. added theissue type on Jun 17, 2026
  2. spacebear21 commented on Jun 17, 2026

    @spacebear21
    CollaboratorAuthor

    This is actually a bug in replay_event_log, because it returns an Expiration error upon replay if the expiration duration has elapsed.

  3. added
    bug
    and removed on Jun 17, 2026
  4. changed the title [-]payjoin-cli history command displays "expired" status for successfully completed sessions[/-] [+]Replaying the event log results in "expired" error for successfully completed sessions[/+] on Jun 17, 2026
  5. added this to the payjoin-1.0 milestone on Jun 17, 2026
  6. zealsham commented on Jun 17, 2026

    @zealsham
    Collaborator

    @spacebear21 I’ll work on this if you’re not currently working on it already

  7. Spacebear commented on Jun 18, 2026

    @Spacebear

    @Spacebear I’ll work on this if you’re not currently working on it already

    Hi I think you meant @spacebear21

  8. zealsham commented on Jun 18, 2026

    @zealsham
    Collaborator

    @Spacebear I’ll work on this if you’re not currently working on it already

    Hi I think you meant @spacebear21

    omg!, i'm so sorry for the tag. i blindly trusted github suggestion

  9. benalleng commented on Jun 23, 2026

    @benalleng
    Collaborator

    We only want this error when the session still beleives that the session is active so something like

    // deleted as it did not work

    should be sufficient IMO Edit: this did not work as expected so I think I need to rethink what this block is looking for

  10. zealsham commented on Jun 23, 2026

    @zealsham
    Collaborator

    i was able to trace this to constructHistory for both receive and send returning InternalReplayError::Expired if expiration has elpased

  11. benalleng commented on Jun 24, 2026

    @benalleng
    Collaborator

    From #1672 (comment)

    consider whether replay_event_log should error at all on expired sessions

    The strongest reason to keep it this way is that this explicitly forces sessions to be dropped when they expire, otherwise implementers can run resume on expired sessions if they don't properly look for the SessionStatus::Expired beforehand

  12. spacebear21 commented on Jun 24, 2026

    @spacebear21
    CollaboratorAuthor

    The strongest reason to keep it this way is that this explicitly forces sessions to be dropped when they expire, otherwise implementers can run resume on expired sessions if they don't properly look for the SessionStatus::Expired beforehand

    This is a good point and I actually ran into this issue locally after attempting to remove the expiration error on replay.

  13. spacebear21 commented on Jun 24, 2026

    @spacebear21
    CollaboratorAuthor

    #1672 addresses the core bug in replay_event_log, but I'm keeping this open until we revisit the payjoin-cli history display for expired sessions which is still confusing

  14. benalleng commented on Jun 25, 2026

    @benalleng
    Collaborator

    I think we can solve this in 2 ways.

    1. rename the column
      • Ended at
      • Closed at
      • Terminated at
      • Terminal timestamp
    2. Make it such that only Success and FallbackBroadcast are the only two states to show a completed at timestamp all others remain Not Complete
  15. spacebear21 commented on Jun 25, 2026

    @spacebear21
    CollaboratorAuthor
    1. Remove the Completed At column (it doesn't seem particularly valuable imo especially without human readable time)
  16. linked a pull request that will close this issueRemove Completed at history column #1683on Jun 25, 2026
  17. DanGould commented on Jun 30, 2026

    @DanGould
    Member

    if it's just in the DB it's useful for resuming sessions > resumed. Just removing the column from the display is good. "Closed at" could work for display but imoh it's not necessary. Seems like it either expires, or you have a transaction in a block with that block's timestamp (or detection time if you're super detailed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions