Fix import tool fails to restore registry entries
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user