From 8a575cc142713e168ee7b802c945fa0b3f696e54 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 28 Aug 2026 01:00:36 -0400 Subject: [PATCH 1/2] test(ledger): a soft-dropped ledger reads as absent from exists() 43d758610 made ledger_exists treat a retracted record as not-found on the query path, matching LedgerState::load: a dropped ledger must not load or serve queries, so it must not report as existing either. The assertion here still encoded the older contract -- exists() as "is there a record" -- and has been red on main since that merge. Updates the assertion and the comment to state the current contract and why the record still exists on a tombstoning nameservice while exists() answers false. --- fluree-db-api/tests/it_ledger_lifecycle.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fluree-db-api/tests/it_ledger_lifecycle.rs b/fluree-db-api/tests/it_ledger_lifecycle.rs index ecb5add175..01b4aadbf0 100644 --- a/fluree-db-api/tests/it_ledger_lifecycle.rs +++ b/fluree-db-api/tests/it_ledger_lifecycle.rs @@ -210,15 +210,18 @@ async fn ledger_exists_on_file_storage() { "a malformed id must be an Err, so callers cannot mistake it for absence", ); - // A soft-dropped ledger still has a (retracted) record: `exists` - // is "is there a record", not "is it live". + // A soft-dropped ledger reads as absent. The record survives on a + // tombstoning nameservice so admin tooling can read the retracted + // flag, but `exists` is a query-path question: a dropped ledger must + // not load or serve queries, so it must not report as existing + // either. See 43d758610. fluree .drop_ledger("x", fluree_db_api::DropMode::Soft) .await .unwrap(); assert!( - fluree.ledger_exists("x:main").await.unwrap(), - "exists() reports the record, which a soft drop keeps", + !fluree.ledger_exists("x:main").await.unwrap(), + "a retracted record is not a live ledger, so exists() reports false", ); } From 7173e67054401130f150edc2df30bafa537f0b22 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 28 Aug 2026 10:43:06 -0400 Subject: [PATCH 2/2] docs(test): cite #1716 alongside the bare SHA --- fluree-db-api/tests/it_ledger_lifecycle.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fluree-db-api/tests/it_ledger_lifecycle.rs b/fluree-db-api/tests/it_ledger_lifecycle.rs index 01b4aadbf0..c25c8e2501 100644 --- a/fluree-db-api/tests/it_ledger_lifecycle.rs +++ b/fluree-db-api/tests/it_ledger_lifecycle.rs @@ -214,7 +214,7 @@ async fn ledger_exists_on_file_storage() { // tombstoning nameservice so admin tooling can read the retracted // flag, but `exists` is a query-path question: a dropped ledger must // not load or serve queries, so it must not report as existing - // either. See 43d758610. + // either. See 43d758610 (#1716). fluree .drop_ledger("x", fluree_db_api::DropMode::Soft) .await