From 7e21ff6f4bb7d429ccd82496645275fa92ccb3d0 Mon Sep 17 00:00:00 2001 From: Maurus Decimus <11444311+mdecimus@users.noreply.github.com> Date: Mon, 4 May 2026 17:25:40 +0200 Subject: [PATCH] Fix import tool fails to restore registry entries --- CHANGELOG.md | 1 + crates/common/src/manager/restore.rs | 5 ++--- tests/src/store/import_export.rs | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 699ad765..e559a6b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If - Pagination by anchor for queued messages, tasks and metrics. - Spam filter: Use original instead of rewritten `RCPT` on checks. - JMAP references in nested objects not resolved. +- Import tool fails to restore registry entries. ## [0.16.3] - 2026-04-30 diff --git a/crates/common/src/manager/restore.rs b/crates/common/src/manager/restore.rs index 5e19df60..116e29fb 100644 --- a/crates/common/src/manager/restore.rs +++ b/crates/common/src/manager/restore.rs @@ -14,8 +14,7 @@ use std::{ path::{Path, PathBuf}, }; use store::{ - BlobStore, SUBSPACE_BLOBS, SUBSPACE_COUNTER, SUBSPACE_INDEXES, SUBSPACE_QUOTA, - SUBSPACE_REGISTRY_IDX, Store, U32_LEN, + BlobStore, SUBSPACE_BLOBS, SUBSPACE_COUNTER, SUBSPACE_INDEXES, SUBSPACE_QUOTA, Store, U32_LEN, write::{AnyClass, BatchBuilder, ValueClass, key::DeserializeBigEndian}, }; use types::{collection::Collection, field::Field}; @@ -85,7 +84,7 @@ async fn restore_file(store: Store, blob_store: BlobStore, path: &Path) { } } } - SUBSPACE_INDEXES | SUBSPACE_REGISTRY_IDX => { + SUBSPACE_INDEXES => { while let Some((key, _)) = reader.next() { let account_id = key .as_slice() diff --git a/tests/src/store/import_export.rs b/tests/src/store/import_export.rs index f13b47f6..2939387a 100644 --- a/tests/src/store/import_export.rs +++ b/tests/src/store/import_export.rs @@ -146,6 +146,24 @@ pub async fn test(test: &TestServer) { }), random_bytes(idx + 10), ); + batch.set( + ValueClass::Registry(RegistryClass::IndexId { + object_id: idx as u16, + item_id: idx as u64 * 100, + }), + vec![], + ); + for index_id in 0u16..3 { + batch.set( + ValueClass::Registry(RegistryClass::Index { + object_id: idx as u16, + index_id, + key: random_bytes(idx + index_id as usize), + item_id: idx as u64 * 100, + }), + vec![], + ); + } } db.write(batch.build_all()).await.unwrap();