From 50f9c1837b381ff139ff0815ad9b0e7d362a02a3 Mon Sep 17 00:00:00 2001 From: Adrian-Stefan Mares Date: Fri, 11 Aug 2023 10:20:30 +0200 Subject: [PATCH] as: Use full identifiers on uplink generation --- pkg/applicationserver/applicationserver.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/applicationserver/applicationserver.go b/pkg/applicationserver/applicationserver.go index dc952d479b2..ffccc32685e 100644 --- a/pkg/applicationserver/applicationserver.go +++ b/pkg/applicationserver/applicationserver.go @@ -754,16 +754,16 @@ func (as *ApplicationServer) downlinkQueueOp(ctx context.Context, ids *ttnpb.End } } - registerReceiveDownlinks(ctx, ids, items) + registerReceiveDownlinks(ctx, dev.Ids, items) mask, err := as.attemptDownlinkQueueOp(ctx, dev, link, peer, downlinkQueueOperation{ Items: items, Operation: op, ResultFunc: func(decrypted, encrypted []*ttnpb.ApplicationDownlink, err error) { if err != nil { - as.registerDropDownlinks(ctx, ids, decrypted, now, err) + as.registerDropDownlinks(ctx, dev.Ids, decrypted, now, err) } else { - as.registerForwardDownlinks(ctx, ids, decrypted, encrypted, now) + as.registerForwardDownlinks(ctx, dev.Ids, decrypted, encrypted, now) } }, }) @@ -1005,7 +1005,7 @@ func (as *ApplicationServer) handleJoinAccept( for _, msg := range joinAccept.InvalidatedDownlinks { if err := as.decryptDownlink(ctx, dev, msg, previousSession); err != nil { logger.WithError(err).Warn("Failed to decrypt downlink message; drop item") - registerDropDownlink(ctx, ids, msg, err) + registerDropDownlink(ctx, dev.Ids, msg, err) continue } items = append(items, msg) @@ -1023,7 +1023,7 @@ func (as *ApplicationServer) handleJoinAccept( SkipSessionKeyIDs: [][]byte{items[0].SessionKeyId}, ResultFunc: func(decrypted, _ []*ttnpb.ApplicationDownlink, err error) { if err != nil { - as.registerDropDownlinks(ctx, ids, decrypted, receivedAt, err) + as.registerDropDownlinks(ctx, dev.Ids, decrypted, receivedAt, err) } }, }) @@ -1334,7 +1334,7 @@ func (as *ApplicationServer) handleDownlinkQueueInvalidated( for _, msg := range invalid.Downlinks { if err := as.decryptDownlink(ctx, dev, msg, nil); err != nil { log.FromContext(ctx).WithError(err).Warn("Failed to decrypt downlink message; drop item") - registerDropDownlink(ctx, ids, msg, err) + registerDropDownlink(ctx, dev.Ids, msg, err) continue } items = append(items, msg) @@ -1348,7 +1348,7 @@ func (as *ApplicationServer) handleDownlinkQueueInvalidated( Operation: ttnpb.AsNsClient.DownlinkQueuePush, ResultFunc: func(decrypted, _ []*ttnpb.ApplicationDownlink, err error) { if err != nil { - as.registerDropDownlinks(ctx, ids, decrypted, receivedAt, err) + as.registerDropDownlinks(ctx, dev.Ids, decrypted, receivedAt, err) } }, }) @@ -1420,7 +1420,7 @@ func (as *ApplicationServer) handleDownlinkNack( if msg.ConfirmedRetry.Attempt > maxRetries { as.registerDropDownlinks( ctx, - ids, + dev.Ids, items, receivedAt, errMaxRetriesReached.WithAttributes("max_retries", maxRetries), @@ -1433,7 +1433,7 @@ func (as *ApplicationServer) handleDownlinkNack( Operation: ttnpb.AsNsClient.DownlinkQueuePush, ResultFunc: func(decrypted, _ []*ttnpb.ApplicationDownlink, err error) { if err != nil { - as.registerDropDownlinks(ctx, ids, decrypted, receivedAt, err) + as.registerDropDownlinks(ctx, dev.Ids, decrypted, receivedAt, err) } }, })