diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp index 864a56895b..6944bdcac3 100644 --- a/src/daemon/daemon.cpp +++ b/src/daemon/daemon.cpp @@ -1649,7 +1649,8 @@ try // clang-format on std::unordered_set images_found; auto action = [&images_found, &default_remote, request, &response](const std::string& remote, const mp::VMImageInfo& info) { - if ((info.supported || request->allow_unsupported()) && !info.aliases.empty() && + if (remote != mp::snapcraft_remote && (info.supported || request->allow_unsupported()) && + !info.aliases.empty() && images_found.find(info.release_title.toStdString()) == images_found.end()) { add_aliases(response.mutable_images_info(), remote, info, default_remote); diff --git a/tests/test_daemon_find.cpp b/tests/test_daemon_find.cpp index d368ca6959..e5992cea43 100644 --- a/tests/test_daemon_find.cpp +++ b/tests/test_daemon_find.cpp @@ -89,14 +89,16 @@ TEST_F(DaemonFind, blankQueryReturnsAllData) EXPECT_THAT(stream.str(), AllOf(HasSubstr(mpt::default_alias), HasSubstr(mpt::default_release_info), HasSubstr(mpt::another_alias), HasSubstr(mpt::another_release_info), - HasSubstr(fmt::format("{}:{}", mpt::snapcraft_remote, mpt::snapcraft_alias)), - HasSubstr(mpt::snapcraft_release_info), HasSubstr(fmt::format("{}:{}", mpt::custom_remote, mpt::custom_alias)), HasSubstr(mpt::custom_release_info), HasSubstr(blueprint1_name), HasSubstr(blueprint_description_for(blueprint1_name)), HasSubstr(blueprint2_name), HasSubstr(blueprint_description_for(blueprint2_name)))); - EXPECT_EQ(total_lines_of_output(stream), 10); + EXPECT_THAT(stream.str(), + Not(AllOf(HasSubstr(fmt::format("{}:{}", mpt::snapcraft_remote, mpt::snapcraft_alias)), + HasSubstr(mpt::snapcraft_release_info)))); + + EXPECT_EQ(total_lines_of_output(stream), 9); } TEST_F(DaemonFind, queryForDefaultReturnsExpectedData)