Skip to content

DataSent and DataQueued events should be handled gracefully in the TransferFinished state #234

@aarshkshah1992

Description

@aarshkshah1992
  • After a data-transfer restart, Graphsync can still call the OnDataSent hook for blocks that have already been sent which in turn will fire the DataSent data-transfer event. The same applies to the DataQueued event.
  • To ensure we don't double count data sent, we introduced a DataSentProgress and a DataQueuedProgress events a while ago in Dont double count data sent #185. These events are only emitted the first time we send a block to a remote peer.
  • Thus, if a data-transfer restarts after entering the TransferFinished state, we can still receive DataSent and DataQueued events for blocks that have already been sent. We need to handle these events gracefully in the TransferFinished state.

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