Reset IMAP UIDs endpoint

This commit is contained in:
mdecimus
2025-01-03 09:15:05 +01:00
parent 16f9f3fa1b
commit 7dfaa5bf11
19 changed files with 204 additions and 90 deletions

View File

@@ -17,7 +17,7 @@ use jmap_proto::types::{collection::Collection, property::Property};
use store::{
write::{
key::DeserializeBigEndian, AnyKey, BitmapClass, BitmapHash, BlobOp, DirectoryClass,
LookupClass, QueueClass, QueueEvent, TagValue, ValueClass,
InMemoryClass, QueueClass, QueueEvent, TagValue, ValueClass,
},
BitmapKey, Deserialize, IndexKey, IterateParams, LogKey, Serialize, ValueKey,
SUBSPACE_BITMAP_ID, SUBSPACE_BITMAP_TAG, SUBSPACE_BITMAP_TEXT, U32_LEN, U64_LEN,
@@ -538,13 +538,13 @@ impl Core {
account_id: 0,
collection: 0,
document_id: 0,
class: ValueClass::Lookup(LookupClass::Key(vec![0])),
class: ValueClass::InMemory(InMemoryClass::Key(vec![0])),
},
ValueKey {
account_id: u32::MAX,
collection: u8::MAX,
document_id: u32::MAX,
class: ValueClass::Lookup(LookupClass::Key(vec![
class: ValueClass::InMemory(InMemoryClass::Key(vec![
u8::MAX,
u8::MAX,
u8::MAX,
@@ -578,13 +578,13 @@ impl Core {
account_id: 0,
collection: 0,
document_id: 0,
class: ValueClass::Lookup(LookupClass::Counter(vec![0])),
class: ValueClass::InMemory(InMemoryClass::Counter(vec![0])),
},
ValueKey {
account_id: u32::MAX,
collection: u8::MAX,
document_id: u32::MAX,
class: ValueClass::Lookup(LookupClass::Counter(vec![
class: ValueClass::InMemory(InMemoryClass::Counter(vec![
u8::MAX,
u8::MAX,
u8::MAX,
@@ -611,9 +611,9 @@ impl Core {
for key in counters {
let value = store
.get_counter(ValueKey::from(ValueClass::Lookup(LookupClass::Counter(
key.clone(),
))))
.get_counter(ValueKey::from(ValueClass::InMemory(
InMemoryClass::Counter(key.clone()),
)))
.await
.failed("Failed to get counter");

View File

@@ -15,7 +15,7 @@ use store::{
roaring::RoaringBitmap,
write::{
key::DeserializeBigEndian, BatchBuilder, BitmapClass, BitmapHash, BlobOp, DirectoryClass,
LookupClass, MaybeDynamicId, MaybeDynamicValue, Operation, TagValue, TaskQueueClass,
InMemoryClass, MaybeDynamicId, MaybeDynamicValue, Operation, TagValue, TaskQueueClass,
ValueClass,
},
BlobStore, Serialize, Store, U32_LEN,
@@ -167,11 +167,11 @@ async fn restore_file(store: Store, blob_store: BlobStore, path: &Path) {
batch.set(ValueClass::Config(key), value);
}
Family::LookupValue => {
batch.set(ValueClass::Lookup(LookupClass::Key(key)), value);
batch.set(ValueClass::InMemory(InMemoryClass::Key(key)), value);
}
Family::LookupCounter => {
batch.add(
ValueClass::Lookup(LookupClass::Counter(key)),
ValueClass::InMemory(InMemoryClass::Counter(key)),
i64::deserialize(&value).expect("Failed to deserialize counter"),
);
}