From 9dcf0bdd9a02970542cee89cf9ee19756fb13a4c Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 3 Mar 2023 18:44:39 +0100 Subject: [PATCH] Fix #1785: Ensure up-to-date status for re-pinned items. --- pintracker/optracker/operation.go | 1 - pintracker/optracker/operationtracker.go | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pintracker/optracker/operation.go b/pintracker/optracker/operation.go index 1196316c..60977bd2 100644 --- a/pintracker/optracker/operation.go +++ b/pintracker/optracker/operation.go @@ -56,7 +56,6 @@ type Operation struct { tracker *OperationTracker - // RO fields opType OperationType pin api.Pin diff --git a/pintracker/optracker/operationtracker.go b/pintracker/optracker/operationtracker.go index 514e0625..a3de9929 100644 --- a/pintracker/optracker/operationtracker.go +++ b/pintracker/optracker/operationtracker.go @@ -86,7 +86,9 @@ func (opt *OperationTracker) TrackNewOperation(ctx context.Context, pin api.Pin, if ok { // operation exists for the CID if op.Type() == typ && op.Phase() != PhaseError && op.Phase() != PhaseDone { // an ongoing operation of the same - // type. i.e. pinning, or queued. + // type. i.e. pinning, or queued. Update the pin + // object though, as it may have different options. + op.pin = pin return nil } // i.e. operations in error phase