From 211b110fe30bbdd786647964056fd323ae0fdc24 Mon Sep 17 00:00:00 2001 From: Vlad Vitan <23100181+vlasebian@users.noreply.github.com> Date: Wed, 29 Apr 2026 14:40:20 +0300 Subject: [PATCH 1/4] tts: Strip ids.dev_addr from exported devices --- pkg/source/tts/source.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/source/tts/source.go b/pkg/source/tts/source.go index 56dd69e..97647c6 100644 --- a/pkg/source/tts/source.go +++ b/pkg/source/tts/source.go @@ -73,10 +73,15 @@ func (s Source) ExportDevice(devID string) (*ttnpb.EndDevice, error) { if err := validateDeviceIds(dev.Ids, res.Ids); err != nil { return nil, err } - paths := ttnpb.AddFields(nsPaths, ttnpb.AddFields(asPaths, ttnpb.AddFields(jsPaths, "ids.dev_addr")...)...) + paths := ttnpb.AddFields(nsPaths, ttnpb.AddFields(asPaths, jsPaths...)...) if err := dev.SetFields(res, paths...); err != nil { return nil, err } + // Clear ids.dev_addr (denormalized session state) so the export can be + // re-imported via the CLI; session.dev_addr remains the source of truth. + if dev.Ids != nil { + dev.Ids.DevAddr = nil + } // Clear all "{server}_address" fields from exported device if err := dev.SetFields(nil, "application_server_address", "join_server_address", "network_server_address"); err != nil { return nil, err From 2c657fd275f34edee90154cfb6476c6da18f41ac Mon Sep 17 00:00:00 2001 From: Vlad Vitan <23100181+vlasebian@users.noreply.github.com> Date: Wed, 29 Apr 2026 14:55:08 +0300 Subject: [PATCH 2/4] tts: Fix application mode in TTS iterator --- pkg/source/tts/source.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/source/tts/source.go b/pkg/source/tts/source.go index 97647c6..3c784d8 100644 --- a/pkg/source/tts/source.go +++ b/pkg/source/tts/source.go @@ -113,7 +113,10 @@ func (s Source) ExportDevice(devID string) (*ttnpb.EndDevice, error) { } // Iterator implements source.Source. -func (s Source) Iterator(bool) iterator.Iterator { +func (s Source) Iterator(isApplication bool) iterator.Iterator { + if isApplication && s.config.AppID != "" { + return iterator.NewListIterator([]string{s.config.AppID}) + } return iterator.NewReaderIterator(os.Stdin, '\n') } From 13d3af482c4129eca38768d7b933f0d358d4685f Mon Sep 17 00:00:00 2001 From: Vlad Vitan <23100181+vlasebian@users.noreply.github.com> Date: Wed, 29 Apr 2026 14:56:52 +0300 Subject: [PATCH 3/4] Ignore go vendor directory --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 4fcbbe9..00295aa 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,6 @@ # macOS related *.DS_store + +# Go +**/vendor/* From 762abd840a86af3b41092edab8f422eb1b2b43a2 Mon Sep 17 00:00:00 2001 From: Vlad Vitan <23100181+vlasebian@users.noreply.github.com> Date: Wed, 29 Apr 2026 15:33:47 +0300 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdaf419..bcfa77d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed +- Strip ids.dev_addr from exported devices + ## [v0.12.0] (2024-03-13) ### Added @@ -145,6 +147,3 @@ NOTE: These links should respect backports. See https://github.com/TheThingsNetw --> [unreleased]: https://github.com/TheThingsNetwork/lorawan-stack-migrate/v0.7.0...master -[0.7.0]: https://github.com/TheThingsNetwork/lorawan-stack-migrate/compare/v0.6.0...v0.7.0 -[0.6.0]: https://github.com/TheThingsNetwork/lorawan-stack-migrate/compare/v0.5.0...v0.6.0 -[0.5.0]: https://github.com/TheThingsNetwork/lorawan-stack-migrate/compare/v0.4.0...v0.5.0