Telemetry fixes

This commit is contained in:
Maurus Decimus
2026-04-12 18:52:18 +02:00
parent 1afad4d843
commit 7564f51642
47 changed files with 2070 additions and 344 deletions

View File

@@ -144,6 +144,7 @@ impl MethodName {
(MethodFunction::Get, MethodObject::AddressBook) => "AddressBook/get",
(MethodFunction::Changes, MethodObject::AddressBook) => "AddressBook/changes",
(MethodFunction::Set, MethodObject::AddressBook) => "AddressBook/set",
(MethodFunction::Query, MethodObject::AddressBook) => "AddressBook/query",
(MethodFunction::Get, MethodObject::ContactCard) => "ContactCard/get",
(MethodFunction::Changes, MethodObject::ContactCard) => "ContactCard/changes",
@@ -172,6 +173,7 @@ impl MethodName {
(MethodFunction::Get, MethodObject::Calendar) => "Calendar/get",
(MethodFunction::Changes, MethodObject::Calendar) => "Calendar/changes",
(MethodFunction::Set, MethodObject::Calendar) => "Calendar/set",
(MethodFunction::Query, MethodObject::Calendar) => "Calendar/query",
(MethodFunction::Get, MethodObject::CalendarEvent) => "CalendarEvent/get",
(MethodFunction::Changes, MethodObject::CalendarEvent) => "CalendarEvent/changes",
@@ -277,6 +279,7 @@ impl MethodName {
"AddressBook/get" => (MethodObject::AddressBook, MethodFunction::Get),
"AddressBook/changes" => (MethodObject::AddressBook, MethodFunction::Changes),
"AddressBook/set" => (MethodObject::AddressBook, MethodFunction::Set),
"AddressBook/query" => (MethodObject::AddressBook, MethodFunction::Query),
"ContactCard/get" => (MethodObject::ContactCard, MethodFunction::Get),
"ContactCard/changes" => (MethodObject::ContactCard, MethodFunction::Changes),
@@ -301,6 +304,7 @@ impl MethodName {
"Calendar/get" => (MethodObject::Calendar, MethodFunction::Get),
"Calendar/changes" => (MethodObject::Calendar, MethodFunction::Changes),
"Calendar/set" => (MethodObject::Calendar, MethodFunction::Set),
"Calendar/query" => (MethodObject::Calendar, MethodFunction::Query),
"CalendarEvent/get" => (MethodObject::CalendarEvent, MethodFunction::Get),
"CalendarEvent/changes" => (MethodObject::CalendarEvent, MethodFunction::Changes),

View File

@@ -136,8 +136,10 @@ pub enum QueryRequestMethod {
Sieve(QueryRequest<Sieve>),
Principal(QueryRequest<Principal>),
Quota(QueryRequest<Quota>),
AddressBook(QueryRequest<AddressBook>),
ContactCard(QueryRequest<ContactCard>),
FileNode(QueryRequest<FileNode>),
Calendar(QueryRequest<Calendar>),
CalendarEvent(QueryRequest<CalendarEvent>),
CalendarEventNotification(QueryRequest<CalendarEventNotification>),
ShareNotification(QueryRequest<ShareNotification>),

View File

@@ -32,7 +32,8 @@ impl<'x> Request<'x> {
}
Err(err) => Err(trc::JmapEvent::NotRequest
.into_err()
.details(err.to_string())),
.reason(err.to_string())
.details(String::from_utf8_lossy(json).into_owned())),
}
} else {
Err(trc::LimitEvent::SizeRequest.into_err())
@@ -413,6 +414,13 @@ impl<'de> Visitor<'de> for CallVisitor {
return Err(de::Error::invalid_length(1, &self));
}
},
(MethodFunction::Query, MethodObject::Calendar) => match seq.next_element() {
Ok(Some(value)) => RequestMethod::Query(QueryRequestMethod::Calendar(value)),
Err(err) => RequestMethod::invalid(err),
Ok(None) => {
return Err(de::Error::invalid_length(1, &self));
}
},
(MethodFunction::Query, MethodObject::CalendarEvent) => match seq.next_element() {
Ok(Some(value)) => RequestMethod::Query(QueryRequestMethod::CalendarEvent(value)),
Err(err) => RequestMethod::invalid(err),
@@ -431,6 +439,13 @@ impl<'de> Visitor<'de> for CallVisitor {
}
}
}
(MethodFunction::Query, MethodObject::AddressBook) => match seq.next_element() {
Ok(Some(value)) => RequestMethod::Query(QueryRequestMethod::AddressBook(value)),
Err(err) => RequestMethod::invalid(err),
Ok(None) => {
return Err(de::Error::invalid_length(1, &self));
}
},
(MethodFunction::Query, MethodObject::ContactCard) => match seq.next_element() {
Ok(Some(value)) => RequestMethod::Query(QueryRequestMethod::ContactCard(value)),
Err(err) => RequestMethod::invalid(err),