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:
1 parent
7134bac7f7
commit
a0ed3cf69c
1 file changed
+8
-2
@@ -6838,9 +6838,15 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
return null;
|
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>{
|
final candidates = <String>{
|
||||||
...RegionStore().loadRegions(),
|
for (final region in [
|
||||||
..._channelRegions.values,
|
...RegionStore().loadRegions(),
|
||||||
|
..._channelRegions.values,
|
||||||
|
_defaultRegion,
|
||||||
|
])
|
||||||
|
region.startsWith('#') ? region.substring(1) : region,
|
||||||
}.where((region) => region.trim().isNotEmpty).toList()..sort();
|
}.where((region) => region.trim().isNotEmpty).toList()..sort();
|
||||||
String? match;
|
String? match;
|
||||||
for (final region in candidates) {
|
for (final region in candidates) {
|
||||||
|
|||||||
Reference in new issue
Block a user