Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
Stop returning join nonces through API
Browse files Browse the repository at this point in the history
Otherwise the RPC responses become very big.
  • Loading branch information
htdvisser committed Oct 3, 2018
1 parent f7cfd32 commit c29fe46
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/handler/manager_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ func (h *handlerManager) GetDevice(ctx context.Context, in *pb_handler.DeviceIde
pbDev.GetLoRaWANDevice().FCntDown = nsDev.FCntDown
pbDev.GetLoRaWANDevice().LastSeen = nsDev.LastSeen

if dev := pbDev.GetLoRaWANDevice(); dev != nil {
dev.UsedAppNonces = nil
dev.UsedDevNonces = nil
}

return pbDev, nil
}

Expand Down Expand Up @@ -323,6 +328,13 @@ func (h *handlerManager) GetDevicesForApplication(ctx context.Context, in *pb_ha
res.Devices = append(res.Devices, dev.ToPb())
}

for _, dev := range res.Devices {
if dev := dev.GetLoRaWANDevice(); dev != nil {
dev.UsedAppNonces = nil
dev.UsedDevNonces = nil
}
}

total, selected := opts.GetTotalAndSelected()
header := metadata.Pairs(
"total", strconv.FormatUint(total, 10),
Expand Down

0 comments on commit c29fe46

Please sign in to comment.