@@ -270,7 +270,9 @@ func (ou *operationUpdater) doBatchUpdate(ctx context.Context, updates []*core.O
270270 if err != nil {
271271 return err
272272 }
273- transactions = append (transactions , transaction )
273+ if transaction != nil {
274+ transactions = append (transactions , transaction )
275+ }
274276 }
275277 }
276278
@@ -310,21 +312,33 @@ func (ou *operationUpdater) doUpdate(ctx context.Context, update *core.Operation
310312 }
311313
312314 // Match a TX we already retrieved, if found add a specified Blockchain Transaction ID to it
315+ var txnIDStr string
316+ var idempotencyKeyStr string
313317 var tx * core.Transaction
314- if op .Transaction != nil && update . BlockchainTXID != "" {
318+ if op .Transaction != nil {
315319 for _ , candidate := range transactions {
316320 if op .Transaction .Equals (candidate .ID ) {
317321 tx = candidate
322+ txnIDStr = candidate .ID .String ()
323+ idempotencyKeyStr = string (candidate .IdempotencyKey )
318324 break
319325 }
320326 }
321327 }
322- if tx != nil {
328+ if tx != nil && update . BlockchainTXID != "" {
323329 if err := ou .txHelper .AddBlockchainTX (ctx , tx , update .BlockchainTXID ); err != nil {
324330 return err
325331 }
326332 }
327333
334+ // This is a key log line, where we can provide all pieces of correlation data a user needs:
335+ // - The type of the operation
336+ // - The plugin/connector
337+ // - The idempotencyKey
338+ // - The FF Transaction ID
339+ // - The Operation ID
340+ log .L (ctx ).Infof ("FF_OPERATION_UPDATE: namespace=%s plugin=%s type=%s status=%s operationId=%s transactionId=%s idempotencyKey='%s'" , op .Namespace , op .Plugin , op .Type , update .Status , op .ID , txnIDStr , idempotencyKeyStr )
341+
328342 if handler , ok := ou .manager .handlers [op .Type ]; ok {
329343 if err := handler .OnOperationUpdate (ctx , op , update ); err != nil {
330344 return err
0 commit comments