From cd5b4bf2d6905d36867cef353d7ccfe70e4f24f9 Mon Sep 17 00:00:00 2001 From: The Things Bot Date: Fri, 20 Oct 2023 14:55:32 +0000 Subject: [PATCH 1/6] all: Bump to version 3.28.0 --- data/lorawan-devices | 2 +- data/lorawan-webhook-templates | 2 +- package.json | 2 +- pkg/version/ttn.go | 2 +- sdk/js/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/lorawan-devices b/data/lorawan-devices index 844d631c05..341ea4c310 160000 --- a/data/lorawan-devices +++ b/data/lorawan-devices @@ -1 +1 @@ -Subproject commit 844d631c05cd29476b3619061cbddd59037020b4 +Subproject commit 341ea4c310c02b020cbf7262f18c182ff46d42dc diff --git a/data/lorawan-webhook-templates b/data/lorawan-webhook-templates index 62f572e227..2c03558427 160000 --- a/data/lorawan-webhook-templates +++ b/data/lorawan-webhook-templates @@ -1 +1 @@ -Subproject commit 62f572e227ecad348cfada942c332967b4a3914e +Subproject commit 2c0355842769995e3f1d304d004303d9671febe0 diff --git a/package.json b/package.json index f466eba1ea..e4621069d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ttn-stack", - "version": "3.27.2", + "version": "3.28.0", "description": "The Things Stack", "main": "index.js", "repository": "https://github.com/TheThingsNetwork/lorawan-stack.git", diff --git a/pkg/version/ttn.go b/pkg/version/ttn.go index 2fa9d9073f..8c7d64eca3 100644 --- a/pkg/version/ttn.go +++ b/pkg/version/ttn.go @@ -3,4 +3,4 @@ package version // TTN Version -var TTN = "3.27.2-dev" +var TTN = "3.28.0-dev" diff --git a/sdk/js/package.json b/sdk/js/package.json index 56f7bddc89..1db9aea484 100644 --- a/sdk/js/package.json +++ b/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "ttn-lw", - "version": "3.27.2", + "version": "3.28.0", "description": "The Things Stack for LoRaWAN JavaScript SDK", "url": "https://github.com/TheThingsNetwork/lorawan-stack/tree/default/sdk/js", "main": "dist/index.js", From 4c32fd0bc32c330474c3556649437763075bffe5 Mon Sep 17 00:00:00 2001 From: Darya Plotnytska Date: Mon, 23 Oct 2023 15:01:27 +0200 Subject: [PATCH 2/6] console: Fix general settings submit --- .../views/gateway-general-settings/index.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pkg/webui/console/views/gateway-general-settings/index.js b/pkg/webui/console/views/gateway-general-settings/index.js index 1d256092a9..278188909f 100644 --- a/pkg/webui/console/views/gateway-general-settings/index.js +++ b/pkg/webui/console/views/gateway-general-settings/index.js @@ -77,12 +77,26 @@ const GatewayGeneralSettingsInner = () => { const handleSubmit = useCallback( async values => { const formValues = { ...values } - const { attributes } = formValues + const { attributes, frequency_plan_ids } = formValues if (isEqual(gateway.attributes || {}, attributes)) { delete formValues.attributes } const changed = diff(gateway, formValues) - const update = 'attributes' in changed ? { ...changed, attributes } : changed + let update + if ('attributes' in changed) { + update = { + ...changed, + attributes, + } + } else if ('frequency_plan_ids' in changed) { + update = { + ...changed, + frequency_plan_ids, + } + } else { + update = changed + } + try { await dispatch(updateGateway(gtwId, update)) toast({ From 685bfd66b7d64ea58305d94ea2220b25f2f979d3 Mon Sep 17 00:00:00 2001 From: Darya Plotnytska Date: Tue, 24 Oct 2023 09:53:53 +0200 Subject: [PATCH 3/6] console: Use diff patch in full --- .../views/gateway-general-settings/index.js | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/pkg/webui/console/views/gateway-general-settings/index.js b/pkg/webui/console/views/gateway-general-settings/index.js index 278188909f..47e5426945 100644 --- a/pkg/webui/console/views/gateway-general-settings/index.js +++ b/pkg/webui/console/views/gateway-general-settings/index.js @@ -81,24 +81,17 @@ const GatewayGeneralSettingsInner = () => { if (isEqual(gateway.attributes || {}, attributes)) { delete formValues.attributes } - const changed = diff(gateway, formValues) - let update - if ('attributes' in changed) { - update = { - ...changed, - attributes, - } - } else if ('frequency_plan_ids' in changed) { - update = { - ...changed, - frequency_plan_ids, - } - } else { - update = changed + if (isEqual(gateway.frequency_plan_ids || {}, frequency_plan_ids)) { + delete formValues.frequency_plan_ids } + const changed = diff(gateway, formValues, { + patchArraysItems: false, + patchInFull: ['attributes', 'frequency_plan_ids'], + }) + try { - await dispatch(updateGateway(gtwId, update)) + await dispatch(updateGateway(gtwId, changed)) toast({ title: gtwId, message: m.updateSuccess, From ed86bd7e686781fddc94ddc6f2d6ac7c4a636f7f Mon Sep 17 00:00:00 2001 From: Adrian-Stefan Mares Date: Wed, 25 Oct 2023 14:43:22 +0200 Subject: [PATCH 4/6] all: Fix events upper bound --- pkg/events/batch/batch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/events/batch/batch.go b/pkg/events/batch/batch.go index 86ed535a6c..dbbabf7abb 100644 --- a/pkg/events/batch/batch.go +++ b/pkg/events/batch/batch.go @@ -41,7 +41,7 @@ func (bp *batchPublisher) process(ctx context.Context) error { flushed := false for n := len(batch); n >= lowerBound; n = len(batch) { toFlush := n - if upperBound := 2 * lowerBound; n > upperBound { + if upperBound := 2 * bp.targetSize; n > upperBound { toFlush = upperBound } select { From 520de4c273bbff1c44173424dc314712964c61dd Mon Sep 17 00:00:00 2001 From: Adrian-Stefan Mares Date: Fri, 27 Oct 2023 14:23:51 +0200 Subject: [PATCH 5/6] ns: Update retry logic --- pkg/networkserver/grpc_asns.go | 5 ++++- pkg/networkserver/utils.go | 17 +++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/pkg/networkserver/grpc_asns.go b/pkg/networkserver/grpc_asns.go index e67cae7018..acd2ee4236 100644 --- a/pkg/networkserver/grpc_asns.go +++ b/pkg/networkserver/grpc_asns.go @@ -105,7 +105,10 @@ func (ns *NetworkServer) processApplicationUplinkTask(ctx context.Context, consu } cl := ttnpb.NewNsAsClient(conn) if err := ns.sendApplicationUplinks(ctx, cl, ups...); err != nil { - log.FromContext(ctx).WithError(err).Error("Failed to send application uplinks") + log.FromContext(ctx).WithError(err).Warn("Failed to send application uplinks") + if !retryableUplinkError(err) { + return nil + } return err } return nil diff --git a/pkg/networkserver/utils.go b/pkg/networkserver/utils.go index 256896f7d3..ba4cca23d7 100644 --- a/pkg/networkserver/utils.go +++ b/pkg/networkserver/utils.go @@ -412,10 +412,6 @@ func (ns *NetworkServer) submitApplicationUplinks(ctx context.Context, ups ...*t )) if err := ns.uplinkSubmissionPool.Publish(ctx, ups); err != nil { log.FromContext(ctx).WithError(err).Warn("Failed to enqueue application uplinks in submission pool") - if nonRetryableUplinkError(err) { - log.FromContext(ctx).Warn("Error is non-retryable, dropping application uplinks") - return - } ns.enqueueApplicationUplinks(ctx, ups...) return } @@ -430,8 +426,7 @@ func (ns *NetworkServer) handleUplinkSubmission(ctx context.Context, ups []*ttnp } if err := ns.sendApplicationUplinks(ctx, ttnpb.NewNsAsClient(conn), ups...); err != nil { log.FromContext(ctx).WithError(err).Warn("Failed to send application uplinks to Application Server") - if nonRetryableUplinkError(err) { - log.FromContext(ctx).Warn("Error is non-retryable, dropping application uplinks") + if !retryableUplinkError(err) { return } ns.enqueueApplicationUplinks(ctx, ups...) @@ -471,12 +466,10 @@ var ( } ) -func nonRetryableUplinkError(err error) bool { - return errors.IsFailedPrecondition(err) || +func retryableUplinkError(err error) bool { + return errors.IsCanceled(err) || + errors.IsDeadlineExceeded(err) || errors.IsResourceExhausted(err) || errors.IsAborted(err) || - errors.IsUnauthenticated(err) || - errors.IsPermissionDenied(err) || - errors.IsUnimplemented(err) || - errors.IsInternal(err) + errors.IsUnavailable(err) } From c2b3be94dc5c5ed62120ac92c3d337bf734cb989 Mon Sep 17 00:00:00 2001 From: The Things Bot Date: Tue, 31 Oct 2023 14:26:00 +0000 Subject: [PATCH 6/6] all: Enter release date of version 3.28.0 into the changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d6ebd378e..a49ccce58f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ with the exception that this project **does not** follow Semantic Versioning. For details about compatibility between different releases, see the **Commitments and Releases** section of our README. -## [3.28.0] - unreleased +## [3.28.0] - 2023-10-31 ### Added