aboutsummaryrefslogtreecommitdiffstats
path: root/src/m_key_server_sync/test/KeyServerBatchLogicTest.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2026-10-22 22:47:07 +0200
committersaturneric <[email protected]>2026-10-22 22:47:07 +0200
commit7216765fcaf66c5e3813afc4bd663e3ed090ae57 (patch)
tree8bdb74be693e4a9da86d3b67662642465730c66e /src/m_key_server_sync/test/KeyServerBatchLogicTest.cpp
parentfeat(email): re-check open messages when key databases are reloaded (diff)
downloadmodules-7216765fcaf66c5e3813afc4bd663e3ed090ae57.tar.gz
modules-7216765fcaf66c5e3813afc4bd663e3ed090ae57.zip
fix(key_server_sync): stop batches when key databases are reloaded
- listen for KEY_DATABASES_RELOADED and stop batches started before it - say how far a stopped batch got, and that nothing fetched was imported - report a refused import instead of counting the keys as refreshed - tell the user when a single key update cannot be imported
Diffstat (limited to 'src/m_key_server_sync/test/KeyServerBatchLogicTest.cpp')
-rw-r--r--src/m_key_server_sync/test/KeyServerBatchLogicTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/m_key_server_sync/test/KeyServerBatchLogicTest.cpp b/src/m_key_server_sync/test/KeyServerBatchLogicTest.cpp
index 9359410..bdb461a 100644
--- a/src/m_key_server_sync/test/KeyServerBatchLogicTest.cpp
+++ b/src/m_key_server_sync/test/KeyServerBatchLogicTest.cpp
@@ -98,6 +98,12 @@ TEST(KeyServerBatchLogicTest, SummariesCountAndListFailures) {
EXPECT_TRUE(published.contains("keys.openpgp.org"));
}
+TEST(KeyServerBatchLogicTest, AnInterruptedBatchSaysHowFarItGot) {
+ const auto text = KeyServerBatchLogic::InterruptedSummary(2, 5);
+ EXPECT_TRUE(text.contains("2 of 5"));
+ EXPECT_TRUE(text.contains("Nothing fetched was imported"));
+}
+
// "The server does not have this key" is an answer, told apart from a real
// failure by the caller, and never shown in the transport's own wording.
TEST(KeyServerBatchLogicTest, NotFoundIsItsOwnPlainAnswer) {