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.
This commit is contained in:
zjs81 committed 2026-09-27 12:37:45 -07:00
1 parent 7134bac7f7
commit a0ed3cf69c
1 file changed
+8 -2
+8 -2
View File
@@ -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 = <String>{
...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) {