DAV server passing Litmus test suite
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
||||
*/
|
||||
|
||||
use calcard::icalendar::ICalendar;
|
||||
use calcard::icalendar::ICalendar;
|
||||
use jmap_proto::types::{acl::Acl, value::AclGrant};
|
||||
use utils::map::vec_map::VecMap;
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ use std::sync::Arc;
|
||||
|
||||
use common::{FileItem, Files, Server};
|
||||
use jmap_proto::types::collection::Collection;
|
||||
use percent_encoding::NON_ALPHANUMERIC;
|
||||
use trc::AddContext;
|
||||
use utils::bimap::IdBimap;
|
||||
|
||||
@@ -35,12 +34,30 @@ impl FileHierarchy for Server {
|
||||
.get(&account_id)
|
||||
.filter(|x| x.modseq == change_id)
|
||||
{
|
||||
let c = println!(
|
||||
"Hierarchy: {:?}",
|
||||
files
|
||||
.files
|
||||
.iter()
|
||||
.map(|f| f.name.clone())
|
||||
.collect::<Vec<_>>()
|
||||
);
|
||||
Ok(files)
|
||||
} else {
|
||||
let mut files = build_file_hierarchy(self, account_id).await?;
|
||||
files.modseq = change_id;
|
||||
let files = Arc::new(files);
|
||||
self.inner.cache.files.insert(account_id, files.clone());
|
||||
|
||||
let c = println!(
|
||||
"Hierarchy: {:?}",
|
||||
files
|
||||
.files
|
||||
.iter()
|
||||
.map(|f| f.name.clone())
|
||||
.collect::<Vec<_>>()
|
||||
);
|
||||
|
||||
Ok(files)
|
||||
}
|
||||
}
|
||||
@@ -50,10 +67,10 @@ async fn build_file_hierarchy(server: &Server, account_id: u32) -> trc::Result<F
|
||||
let list = server
|
||||
.fetch_folders::<FileNode>(account_id, Collection::FileNode)
|
||||
.await
|
||||
.caused_by(trc::location!())?
|
||||
.format(|f| {
|
||||
f.name = percent_encoding::utf8_percent_encode(&f.name, NON_ALPHANUMERIC).to_string();
|
||||
});
|
||||
.caused_by(trc::location!())?;
|
||||
/*.format(|f| {
|
||||
f.name = percent_encoding::utf8_percent_encode(&f.name, NON_ALPHANUMERIC).to_string();
|
||||
});*/
|
||||
let mut files = Files {
|
||||
files: IdBimap::with_capacity(list.len()),
|
||||
size: std::mem::size_of::<Files>() as u64,
|
||||
|
||||
@@ -23,7 +23,11 @@ impl IndexableObject for FileNode {
|
||||
values.extend([
|
||||
IndexValue::Text {
|
||||
field: Property::Name.into(),
|
||||
value: self.name.to_lowercase().into(),
|
||||
value: percent_encoding::percent_decode_str(&self.name)
|
||||
.decode_utf8()
|
||||
.unwrap_or_else(|_| self.name.as_str().into())
|
||||
.to_lowercase()
|
||||
.into(),
|
||||
},
|
||||
IndexValue::U32 {
|
||||
field: Property::ParentId.into(),
|
||||
|
||||
@@ -9,7 +9,7 @@ pub mod index;
|
||||
|
||||
use dav_proto::schema::request::DeadProperty;
|
||||
use jmap_proto::types::value::AclGrant;
|
||||
use store::{SerializedVersion, SERIALIZE_OBJ_11_V1};
|
||||
use store::{SERIALIZE_OBJ_11_V1, SerializedVersion};
|
||||
use utils::BlobHash;
|
||||
|
||||
#[derive(
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
||||
*/
|
||||
|
||||
pub mod calendar;
|
||||
pub mod calendar;
|
||||
pub mod contact;
|
||||
pub mod file;
|
||||
|
||||
Reference in New Issue
Block a user