Ignore node specific maps when no node is specified
In some contexts, we do a channel lookup without a node. This is
especially true in LogReader when we are looking to register a mutation
callback for a message. In this case, we were matching node specific
maps when we shouldn't be. The end result is that subscribing to `/aos`
was resolving to `/pi2/aos` since that was the first remap found.
Change-Id: I428a01d24c7576ad9588b48ffbfb245d4bd98994
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/configuration_test.cc b/aos/configuration_test.cc
index 64b286e..da96402 100644
--- a/aos/configuration_test.cc
+++ b/aos/configuration_test.cc
@@ -240,6 +240,9 @@
EXPECT_THAT(GetChannel(config, "/batman", ".aos.bar", "app1", pi1),
aos::testing::FlatbufferEq(ExpectedMultinodeLocation()));
+ // Tests that node specific maps get ignored
+ EXPECT_EQ(GetChannel(config, "/batman", ".aos.bar", "", nullptr), nullptr);
+
// Tests that a root map/rename fails with a node specific map for the wrong
// node.
EXPECT_EQ(GetChannel(config, "/batman", ".aos.bar", "app1", pi2), nullptr);