From a0ed3cf69cc5be44aba9b0257e7600353f92d0f1 Mon Sep 17 00:00:00 2001 From: zjs81 Date: Sun, 27 Sep 2026 12:37:45 -0700 Subject: [PATCH] Dedupe region candidates without the # prefix floodScopeKeyForRegion treats `foo` and `#foo` as the same scope, so a region listed both ways matched every packet twice and was always reported as ambiguous. Also consider the default region when resolving. --- lib/connector/meshcore_connector.dart | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/connector/meshcore_connector.dart b/lib/connector/meshcore_connector.dart index 69b4e336..54243b8a 100644 --- a/lib/connector/meshcore_connector.dart +++ b/lib/connector/meshcore_connector.dart @@ -6838,9 +6838,15 @@ class MeshCoreConnector extends ChangeNotifier { return null; } + // `foo` and `#foo` share a scope key, so dedupe without the prefix or a + // region listed both ways would always look ambiguous. final candidates = { - ...RegionStore().loadRegions(), - ..._channelRegions.values, + for (final region in [ + ...RegionStore().loadRegions(), + ..._channelRegions.values, + _defaultRegion, + ]) + region.startsWith('#') ? region.substring(1) : region, }.where((region) => region.trim().isNotEmpty).toList()..sort(); String? match; for (final region in candidates) {